Skip to content

Commit 361f506

Browse files
committed
Terminate a couple strncpy
1 parent 20de792 commit 361f506

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/aureport.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ static int process_logs(void)
172172
clear_config (&config);
173173

174174
strncpy(dirname, user_file, MAXPATHLEN-32);
175+
dirname[MAXPATHLEN-32] = '\0';
175176
if (dirname[strlen(dirname)-1] != '/')
176177
strcat(dirname, "/");
177178
strcat (dirname, "audit.log");

src/ausearch.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ static int process_logs(void)
244244
clear_config (&config);
245245

246246
strncpy(dirname, user_file, MAXPATHLEN-32);
247+
dirname[MAXPATHLEN-32] = '\0';
247248
if (dirname[strlen(dirname)-1] != '/')
248249
strcat(dirname, "/");
249250
strcat (dirname, "audit.log");

0 commit comments

Comments
 (0)