Permalink
Browse files

Fix bad strncpyz. Fixes #466

Found by: jack3
Patch by: Geo
Fixes: #466

HOSTS prefix was being overwritten by a strncpyz that should have been a strncatz.
  • Loading branch information...
vanosg committed Oct 14, 2017
1 parent 855bec7 commit 98cee280733bf5818531cc01d49ba5fa7e4700a5
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/userent.c
View
@@ -1141,7 +1141,7 @@ static void hosts_display(int idx, struct user_entry *e)
strcpy(s, " HOSTS: ");
for (q = e->u.list; q; q = q->next) {
if (s[0] && !s[9])
strncpyz(s, q->extra, sizeof s);
strncat(s, q->extra, (sizeof s - strlen(s) -1));
else if (!s[0])
sprintf(s, " %s", q->extra);
else {

0 comments on commit 98cee28

Please sign in to comment.