mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
fix: V-001 security vulnerability
Automated security fix generated by OrbisAI Security Signed-off-by: orbisai0security <mediratta01.pally@gmail.com>
This commit is contained in:
parent
b3f06c1774
commit
d252b7fcf1
2 changed files with 8 additions and 3 deletions
|
|
@ -344,11 +344,12 @@ obsolete(int *argcp, char **argvp[])
|
|||
warnx("option requires an argument -- %c", *ap);
|
||||
usage();
|
||||
}
|
||||
if ((nargv[0] = malloc(strlen(*argv) + 2 + 1)) == NULL)
|
||||
size_t len = strlen(*argv);
|
||||
if ((nargv[0] = malloc(len + 2 + 1)) == NULL)
|
||||
err(1, NULL);
|
||||
nargv[0][0] = '-';
|
||||
nargv[0][1] = *ap;
|
||||
(void)strcpy(&nargv[0][2], *argv);
|
||||
memcpy(&nargv[0][2], *argv, len + 1);
|
||||
++argv;
|
||||
++nargv;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -398,7 +398,11 @@ again:
|
|||
return;
|
||||
}
|
||||
if (buf[0] != '\n') {
|
||||
(void) strcpy(magtape, buf);
|
||||
free(magtape);
|
||||
if ((magtape = strdup(buf)) == NULL) {
|
||||
fprintf(stderr, "Cannot allocate space for tape name\n");
|
||||
done(1);
|
||||
}
|
||||
magtape[strlen(magtape) - 1] = '\0';
|
||||
}
|
||||
if (pipecmdin) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue