mirror of
https://github.com/myvesta/vesta
synced 2025-08-13 18:17:55 -07:00
Buffer overflow vulnerability fix
This commit is contained in:
parent
c0d5b3765a
commit
9c59a69b1a
1 changed files with 7 additions and 1 deletions
|
@ -45,10 +45,16 @@ int main (int argc, char** argv) {
|
|||
/* open log file */
|
||||
FILE* pFile = fopen ("/usr/local/vesta/log/auth.log","a+");
|
||||
if (NULL == pFile) {
|
||||
printf("Error: can not open file %s \n", argv[0]);
|
||||
printf("Error: can not open file /usr/local/vesta/log/auth.log \n");
|
||||
exit(12);
|
||||
}
|
||||
|
||||
int len = 0;
|
||||
if(strlen(argv[1]) >= 100) {
|
||||
printf("Too long username\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* parse user argument */
|
||||
struct passwd* userinfo = getpwnam(argv[1]);
|
||||
if (NULL != userinfo) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue