mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Do not dump core on 'ipfw add unreach': handling null strings in
fill_reject_code(). Please note ipfw/ipfw2.c is not affected. PR: bin/42304 Submitted by: Andy@wantpackets.com MFC after: 1 day
This commit is contained in:
parent
2da3b2ad29
commit
3ec6f79c1e
1 changed files with 2 additions and 0 deletions
|
|
@ -1063,6 +1063,8 @@ fill_reject_code(u_short *codep, char *str)
|
|||
u_long val;
|
||||
char *s;
|
||||
|
||||
if (str == '\0')
|
||||
errx(EX_DATAERR, "missing unreachable code");
|
||||
val = strtoul(str, &s, 0);
|
||||
if (s != str && *s == '\0' && val < 0x100) {
|
||||
*codep = val;
|
||||
|
|
|
|||
Loading…
Reference in a new issue