> {PATH_MAX}
> Maximum number of bytes in a pathname, including the
> terminating null character.[1]
I stand corrected. I have moved the declaration of 'n' to
the beginning of main (which while not technically required
for c89 compliance, is stylistically consistent with the
rest of the project) a
On Tue, Jul 09, 2013 at 05:48:47PM -0400, Galos, David wrote:
> > The patch introduces buffer overflow. sizeof(buf)-1 should be passed
> > to readlink().
>
> Furthermore, buf should be made (PATH_MAX + 1) bytes in size, so that
> valid paths don't get truncated.
{PATH_MAX}
Maximum number of bytes
> The patch introduces buffer overflow. sizeof(buf)-1 should be passed
> to readlink().
Furthermore, buf should be made (PATH_MAX + 1) bytes in size, so that
valid paths don't get truncated.
Indeed, I overlooked that. I attached the patched patch.
Sincerely,
Willem van de Krol
On Tue, Jul 9, 2013 at 7:35 PM, Michał Kazior wrote:
> On 9 July 2013 19:19, Krol, Willem van de <008...@jfc.nl> wrote:
> > Hello all,
> >
> > The man page of readlink(2) says it "does not append a null byt
On 9 July 2013 19:19, Krol, Willem van de <008...@jfc.nl> wrote:
> Hello all,
>
> The man page of readlink(2) says it "does not append a null byte to buf".
> The readlink utility in sbase, however, assumes it does. I attached a patch.
Hi,
The patch introduces buffer overflow. sizeof(buf)-1 shoul
Hello all,
The man page of readlink(2) says it "does not append a null byte to buf".
The readlink utility in sbase, however, assumes it does. I attached a patch.
Sincerely,
Willem van de Krol
readlink-nullterminate.diff
Description: Binary data