mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
When running 'rrestore foo', you get a segmentation fault because
the obsolete() function to convert dump-style args to getopt-style args doesn't check to see that 'f' really has an argument following the option string in argv[1]. Submitted-By: jmacd
This commit is contained in:
parent
9622579d80
commit
1eb5b41ec8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=17261
1 changed files with 3 additions and 1 deletions
|
@ -308,13 +308,15 @@ obsolete(argcp, argvp)
|
|||
err(1, NULL);
|
||||
|
||||
*nargv++ = *argv;
|
||||
argv += 2;
|
||||
argv += 2, argc -= 2;
|
||||
|
||||
for (flags = 0; *ap; ++ap) {
|
||||
switch(*ap) {
|
||||
case 'b':
|
||||
case 'f':
|
||||
case 's':
|
||||
if (argc < 1)
|
||||
usage();
|
||||
if ((nargv[0] = malloc(strlen(*argv) + 2 + 1)) == NULL)
|
||||
err(1, NULL);
|
||||
nargv[0][0] = '-';
|
||||
|
|
Loading…
Reference in a new issue