Updated license file.

Fixes potential buffer overflow on Linux systems. (Thanks to Duncaen for pointing out the issue.)
This commit is contained in:
Jesse Smith 2017-02-24 10:46:46 -04:00
parent 31f072078a
commit 261c216449
2 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
Copyright (c) 2016, Jesse Smith
Copyright (c) 2017, Jesse Smith
All rights reserved.
Redistribution and use in source and binary forms, with or without

6
doas.c
View file

@ -415,10 +415,10 @@ main(int argc, char **argv)
}
#endif
#ifdef linux
strncpy(cmdline, argv[0], sizeof(cmdline));
strncpy(cmdline, argv[0], sizeof(cmdline) - 1);
for (i = 1; i < argc; i++) {
strncat(cmdline, " ", sizeof(cmdline));
strncat(cmdline, argv[i], sizeof(cmdline));
strncat(cmdline, " ", sizeof(cmdline) - strlen(cmdline) - 1);
strncat(cmdline, argv[i], sizeof(cmdline) - strlen(cmdline) - 1);
}
#endif