Skip to content

Commit 9184cf8

Browse files
author
Lucas C. Villa Real
committed
Fixes a potential NULL byte terminator bug.
1 parent 5ea07f3 commit 9184cf8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Runner.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@
5555
char err_msg[ERR_LEN] = "Unexpected error"; \
5656
if (retval) { \
5757
if (use_perror) { \
58-
strncpy(err_msg, strerror(errno), ERR_LEN); \
58+
strncpy(err_msg, strerror(errno), ERR_LEN-1); \
5959
} \
6060
else { \
6161
switch(retval) { \
6262
case ERR_OUTMEMORY: \
63-
strncpy(err_msg, "Not enough memory", ERR_LEN); \
63+
strncpy(err_msg, "Not enough memory", ERR_LEN-1); \
6464
break; \
6565
} \
6666
} \
@@ -754,7 +754,7 @@ main(int argc, char *argv[])
754754
int ret = 1;
755755
int available = 1;
756756

757-
CHECK(parse_arguments(argc, argv), NULL);
757+
CHECK(parse_arguments(argc, argv), false);
758758

759759
if (args.quiet && args.verbose) {
760760
error_printf(main, "--quiet and --verbose are mutually exclusive");

0 commit comments

Comments
 (0)