Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jul 2012 18:35:39 -0400
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
Cc:        Luigi Rizzo <rizzo@iet.unipi.it>, current@freebsd.org
Subject:   Re: RFC: libkern version of inet_ntoa_r
Message-ID:  <CACqU3MVjcHBkc_PYViTX51rJX7m_eq7Bf7uNH0QFqQVnkyddYA@mail.gmail.com>
In-Reply-To: <alpine.BSF.2.00.1207282213171.4474@ai.fobar.qr>
References:  <20120725155211.GA33971@onelab2.iet.unipi.it> <alpine.BSF.2.00.1207282213171.4474@ai.fobar.qr>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Sat, Jul 28, 2012 at 6:14 PM, Bjoern A. Zeeb
<bzeeb-lists@lists.zabbadoz.net> wrote:
> On Wed, 25 Jul 2012, Luigi Rizzo wrote:
>
>> During some ipfw/dummynet cleanup i noticed that the libkern version of
>> inet_ntoa_r() is missing the buffer size argument that is present in
>> the libc counterpart.
>>
>> Any objection if i fix it ?
>
>
> And why exactly would you need it?  What does libc do with it?  Render
> partial IPv4 addresses?
>
Mitigate possibilities of memory corruption ? At the very least, allow
the following:

{
    char tmp[sizeof "255.255.255.255"];

    KASSERT(size >= (sizeof tmp));
    [...]
}

to be enforced... but hey, who gives a damn about consistently doing
things and enforcing code assumptions ? ;-)

 - Arnaud

> --
> Bjoern A. Zeeb                                 You have to have visions!
>          Stop bit received. Insert coin for new address family.
>
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACqU3MVjcHBkc_PYViTX51rJX7m_eq7Bf7uNH0QFqQVnkyddYA>