Skip to content

Commit

Permalink
Fix range check for rtable id.
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Laier authored and Max Laier committed Jun 5, 2008
1 parent 0fbccea commit b18b4da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/contrib/pf/net/pf_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
}

#ifdef __FreeBSD__ /* ROUTEING */
if (rule->rtableid > 0 && rule->rtableid < rt_numfibs)
if (rule->rtableid > 0 && rule->rtableid > rt_numfibs)
#else
if (rule->rtableid > 0 && !rtable_exists(rule->rtableid))
#endif
Expand Down Expand Up @@ -1795,7 +1795,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)

if (newrule->rtableid > 0 &&
#ifdef __FreeBSD__ /* ROUTING */
newrule->rtableid < rt_numfibs)
newrule->rtableid > rt_numfibs)
#else
!rtable_exists(newrule->rtableid))
#endif
Expand Down

0 comments on commit b18b4da

Please sign in to comment.