Use non-exiting allocatings in the sudoers plugin.
This commit is contained in:
@@ -78,7 +78,11 @@ linux_audit_command(char *argv[], int result)
|
||||
/* Convert argv to a flat string. */
|
||||
for (size = 0, av = argv; *av != NULL; av++)
|
||||
size += strlen(*av) + 1;
|
||||
command = cp = sudo_emalloc(size);
|
||||
command = cp = malloc(size);
|
||||
if (command == NULL) {
|
||||
sudo_warn(U_("unable to allocate memory"));
|
||||
goto done;
|
||||
}
|
||||
for (av = argv; *av != NULL; av++) {
|
||||
n = strlcpy(cp, *av, size - (cp - command));
|
||||
if (n >= size - (cp - command)) {
|
||||
@@ -101,7 +105,7 @@ linux_audit_command(char *argv[], int result)
|
||||
rc = 0;
|
||||
|
||||
done:
|
||||
sudo_efree(command);
|
||||
free(command);
|
||||
|
||||
debug_return_int(rc);
|
||||
}
|
||||
|
Reference in New Issue
Block a user