some ftpd implementations mishandle CWD ~{
Wolfram Gloger
wmglo@dent.med.uni-muenchen.de
Thu Apr 26 02:29:00 GMT 2001
> "Gregory A Lundberg" <lundberg@vr.net> writes:
>
> > p = calloc(ULONG_MAX, ULONG_MAX);
> > assert(p == NULL);
> $ ./a.out
> a.out: malloc-test.c:21: main: Assertion `p == ((void *)0)' failed.
> Aborted
>
> Wolfram,
>
> this doesn't look right, can you look into it, please?
Argl, this is a stupid situation. I'm not unwilling to add yet
another overflow check in calloc, but -- at the cost of a division?
Is there a portable check that for "size_t a, b;" (assume b>0) "a*b"
overflows other than something horrible like
if ((a*b)/b != a) ...
Any ideas?
Regards,
Wolfram.
More information about the Libc-hacker
mailing list