Don't die of SIGSEGV on a missing fstype field
in a saved disklabel file. MFC after: 1 week
This commit is contained in:
parent
51a5b7f1ba
commit
29f3f095a6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112945
@ -1134,6 +1134,10 @@ getasciipartspec(char *tp, struct disklabel *lp, int part, int lineno)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
pp->p_offset = v;
|
pp->p_offset = v;
|
||||||
|
if (tp == NULL) {
|
||||||
|
fprintf(stderr, "line %d: missing file system type\n", lineno);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
cp = tp, tp = word(cp);
|
cp = tp, tp = word(cp);
|
||||||
for (cpp = fstypenames; cpp < &fstypenames[FSMAXTYPES]; cpp++)
|
for (cpp = fstypenames; cpp < &fstypenames[FSMAXTYPES]; cpp++)
|
||||||
if (*cpp && streq(*cpp, cp))
|
if (*cpp && streq(*cpp, cp))
|
||||||
|
@ -1134,6 +1134,10 @@ getasciipartspec(char *tp, struct disklabel *lp, int part, int lineno)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
pp->p_offset = v;
|
pp->p_offset = v;
|
||||||
|
if (tp == NULL) {
|
||||||
|
fprintf(stderr, "line %d: missing file system type\n", lineno);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
cp = tp, tp = word(cp);
|
cp = tp, tp = word(cp);
|
||||||
for (cpp = fstypenames; cpp < &fstypenames[FSMAXTYPES]; cpp++)
|
for (cpp = fstypenames; cpp < &fstypenames[FSMAXTYPES]; cpp++)
|
||||||
if (*cpp && streq(*cpp, cp))
|
if (*cpp && streq(*cpp, cp))
|
||||||
|
Loading…
Reference in New Issue
Block a user