This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Implement strlcat [BZ#178]
- From: Zack Weinberg <zackw at panix dot com>
- To: Paul Eggert <eggert at cs dot ucla dot edu>
- Cc: Florian Weimer <fweimer at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 3 Dec 2015 12:36:47 -0500
- Subject: Re: [PATCH] Implement strlcat [BZ#178]
- Authentication-results: sourceware.org; auth=none
- References: <56547472 dot 3010302 at redhat dot com> <5654B1FE dot 5020100 at cs dot ucla dot edu> <5654B796 dot 7070302 at redhat dot com> <5656E018 dot 5020608 at cs dot ucla dot edu> <565F211A dot 2030909 at redhat dot com> <56607CD1 dot 3050209 at cs dot ucla dot edu>
On Thu, Dec 3, 2015 at 12:33 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:
> Come to think of it, this is related to the confusion between one of the
> main goals of strlcpy (namely, the result is always null-terminated), and
> the weird special case where the destination size is zero (where strlcpy
> cannot null-terminate the destination). In practice user code does not and
> should not depend on this weird special case.
I would not at all be surprised to find code deliberately calling
strlcpy with destination size zero in order to learn how big the
destination buffer needed to be.
zw