Make xundump catch extraneous fields
Make deffld() reject fields whose selector has flag NSC_EXTRA set. Since xundump() doesn't provides space for these, the bug could lead to buffer overruns.
This commit is contained in:
parent
c2a687e357
commit
726a8e3dae
1 changed files with 2 additions and 0 deletions
|
@ -352,6 +352,8 @@ deffld(int fldno, char *name, int idx)
|
|||
if (res < 0)
|
||||
return gripe("Header %s of field %d is %s", name, fldno + 1,
|
||||
res == M_NOTUNIQUE ? "ambiguous" : "unknown");
|
||||
if (ca[res].ca_flags == NSC_EXTRA)
|
||||
return gripe("Extraneous header %s in field %d", name, fldno + 1);
|
||||
if (ca[res].ca_type != NSC_STRINGY && ca[res].ca_len != 0) {
|
||||
if (idx < 0)
|
||||
return gripe("Header %s requires an index in field %d",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue