Correctly check the filter length. I committed the wrong version.

Pointy hat to me.
This commit is contained in:
Jung-uk Kim 2006-01-03 20:34:41 +00:00
parent dccb7faff6
commit 142f81c25d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153996

View File

@ -520,7 +520,12 @@ bpf_validate(f, len)
register int i;
register const struct bpf_insn *p;
if (len < 1)
/* Do not accept negative length filter. */
if (len < 0)
return 0;
/* An empty filter means accept all. */
if (len == 0)
return 1;
for (i = 0; i < len; ++i) {