We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f47a27 commit 5b68cdcCopy full SHA for 5b68cdc
src/modules/users.c
@@ -20,7 +20,7 @@ void ffPrintUsers(FFinstance* instance)
20
setutxent();
21
22
FFlist users;
23
- ffListInit(&users, sizeof(n->ut_user));
+ ffListInit(&users, sizeof(n->ut_user) + 1);
24
25
next:
26
while((n = getutxent()))
@@ -32,7 +32,10 @@ void ffPrintUsers(FFinstance* instance)
32
if(strcmp((const char*)ffListGet(&users, i), n->ut_user) == 0)
33
goto next;
34
}
35
- strcpy((char*)ffListAdd(&users), n->ut_user);
+
36
+ char* dest = ffListAdd(&users);
37
+ strncpy(dest, n->ut_user, sizeof(n->ut_user));
38
+ dest[sizeof(n->ut_user)] = '\0';
39
40
41
0 commit comments