mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-25 15:32:07 +00:00
libselinux: audit2why: fix build warnings
Fix the following build warnings. audit2why.c: In function ‘__policy_init’: audit2why.c:207:22: warning: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 4081 [-Wformat-truncation=] "unable to open %s: %s\n", ^~ path, strerror(errno)); ~~~~ audit2why.c:206:4: note: ‘snprintf’ output 20 or more bytes (assuming 4115) into a destination of size 4096 snprintf(errormsg, sizeof(errormsg), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "unable to open %s: %s\n", ~~~~~~~~~~~~~~~~~~~~~~~~~~~ path, strerror(errno)); ~~~~~~~~~~~~~~~~~~~~~~ audit2why.c:253:28: warning: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 4074 [-Wformat-truncation=] "invalid binary policy %s\n", path); ^~ ~~~~ audit2why.c:252:3: note: ‘snprintf’ output between 24 and 4119 bytes into a destination of size 4096 snprintf(errormsg, sizeof(errormsg), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "invalid binary policy %s\n", path); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
This commit is contained in:
parent
e76569f863
commit
c41633b90e
@ -193,7 +193,7 @@ static int __policy_init(const char *init_path)
|
||||
{
|
||||
FILE *fp;
|
||||
char path[PATH_MAX];
|
||||
char errormsg[PATH_MAX];
|
||||
char errormsg[PATH_MAX+1024+20];
|
||||
struct sepol_policy_file *pf = NULL;
|
||||
int rc;
|
||||
unsigned int cnt;
|
||||
|
Loading…
Reference in New Issue
Block a user