:andy wrote @ 20 Jun 2006 21:44:17 +0200:
:
:Fixed the off-by-one:
:http://ftp.fortunaty.net/DragonFly/inofficial/patches/strndup.patch

    Umm.  That code is broken.  len is only the maximum allowed length,
    the actual string may be smaller.

    so e.g. someone might do:  strndup("fubar", 16384).  The returned
    string should only be 'fubar\0', and only 6 bytes should be allocated,
    not 16384.

                                        -Matt
                                        Matthew Dillon 
                                        <[EMAIL PROTECTED]>

Reply via email to