Skip to content

Commit 601e33f

Browse files
committed
Fix strlen warning where possible
1 parent 7035815 commit 601e33f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

asApp/src/dbrestore.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@ int reboot_restore(char *filename, initHookState init_state)
949949
}
950950
n = BUF_SIZE - strlen(value_string) - 1;
951951
strncat(value_string, bp, n);
952+
/* make sure value_string is properly null-terminated */
953+
value_string[BUF_SIZE - 1] = '\0';
952954
/* we don't want that '\n' in the string */
953955
if (value_string[strlen(value_string) - 1] == '\n') value_string[strlen(value_string) - 1] = '\0';
954956
}

0 commit comments

Comments
 (0)