protected against dereferencing rogue pointers
This commit is contained in:
@@ -148,6 +148,7 @@ void log_error(code)
|
||||
* XXX - don't use 33, use a macro!
|
||||
*/
|
||||
count = 33 + 128 + 2 * MAXPATHLEN + strlen(tty) + strlen(cwd);
|
||||
if (NewArgc > 1)
|
||||
for (a = &NewArgv[1]; *a; a++)
|
||||
count += strlen(*a) + 1;
|
||||
|
||||
@@ -288,6 +289,7 @@ void log_error(code)
|
||||
/* XXX - this could be sped up */
|
||||
strcat(logline, cmnd);
|
||||
strcat(logline, " ");
|
||||
if (NewArgc > 1)
|
||||
for (a = &NewArgv[1]; *a; a++) {
|
||||
strcat(logline, *a);
|
||||
strcat(logline, " ");
|
||||
@@ -550,6 +552,7 @@ void inform_user(code)
|
||||
"Sorry, user %s is not allowed to execute \"%s",
|
||||
user_name, cmnd);
|
||||
|
||||
if (NewArgc > 1)
|
||||
for (a = &NewArgv[1]; *a; a++) {
|
||||
fputc(' ', stderr);
|
||||
fputs(*a, stderr);
|
||||
|
Reference in New Issue
Block a user