Re: off by one bounds

From: John Baldwin (jhb_at_FreeBSD.org)
Date: 08/23/04

  • Next message: Dan Nelson: "Re: valgrind on 5.3BETA1"
    To: freebsd-hackers@FreeBSD.org
    Date: Mon, 23 Aug 2004 15:13:13 -0400
    
    

    On Saturday 21 August 2004 07:07 am, Maxim Konovalov wrote:
    > On Sat, 21 Aug 2004, 13:19+0400, Maxim Konovalov wrote:
    > > On Sat, 21 Aug 2004, 05:00-0400, Skip Ford wrote:
    > > > Maxim Konovalov wrote:
    > > > > On Fri, 20 Aug 2004, 12:36-0700, Ted Unangst wrote:
    > > > >> errors in freebsd 4.10 found by Coverity's analysis.
    > > > >>
    > > > >> ip_icmp.c:ip_next_mtu, i == sizeof, dir >= 0
    > > > >
    > > > > If i == sizeof then mtutab[i] == 0
    > > >
    > > > If "i == sizeof" then mtutab[i] is out of bounds, off by one.
    > > > There is no mtutab[sizeof mtutab / sizeof mtutab[0]].
    > > >
    > > > This isn't specific to RELENG_4
    >
    > After the second thought I still think it is not a error. mtu is
    > always >= than the minimal value in mtutab[] that is why i is always
    > less than (sizeof mtutab) / sizeof mtutab[0]). What do you think?

    It's better to fix the code so it doesn't break on unexpected inputs. :)

    -- 
    John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
    "Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: Dan Nelson: "Re: valgrind on 5.3BETA1"

    Relevant Pages

    • Re: off by one bounds
      ... Maxim Konovalov wrote: ... then mtutab is accessed out of bounds. ... To unsubscribe, ...
      (freebsd-hackers)
    • Re: off by one bounds
      ... On Saturday 21 August 2004 07:07 am, Maxim Konovalov wrote: ... It's better to fix the code so it doesn't break on unexpected inputs. ... To unsubscribe, ...
      (freebsd-hackers)
    • Re: off by one bounds
      ... On Sat, 21 Aug 2004, 13:19+0400, Maxim Konovalov wrote: ... less than (sizeof mtutab) / sizeof mtutab). ... To unsubscribe, ...
      (freebsd-hackers)
    • RE: How do I manually set the MTU on a PPP Connection?
      ... Subject: Re: How do I manually set the MTU on a PPP Connection? ... > ...when I dial-up using pppd or wvdial... ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
      (Debian-User)
    • Re: iptables to ipfw
      ... It turns out that openvpn configures tun0 with too small a MTU which causes ... According to RFC 1918, unregistered source ... > as an extra flag to natd ... >> To unsubscribe, send any mail to ...
      (freebsd-questions)