OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Postfix Archives: Re: (off-topic) Re: POP

Re: (off-topic) Re: POP


Subject: Re: (off-topic) Re: POP
From: Fabien Seisen (seisenlinuxfr.org)
Date: Fri Jan 21 2000 - 19:43:09 CST


On Fri, Jan 21, 2000 at 11:44:16AM -0800, Jeremy C. Reed wrote:
> On Fri, 21 Jan 2000, Fabien Seisen wrote:
>
> > Oh noo, not gnu-pop3d, it contains severals bugs.
> > missing bound checkings, tests the return of malloc()'s , ...
>
> I am trying to learn C.
> I understand bound checking problems, but can you explain the bug of
> "tests the return of malloc()'s"?
>
> Is this bad? (An example from gnu-pop3d:)
> apop.c:85: if ((password = malloc (sizeof (char) * APOP_DIGEST)) == NULL)
sprintf (password, "%.*s", (int) data.size, (char *) data.data);

> Or do you mean "not testing"?
> extra.c:324: ret = malloc ((strlen (buf) + 1) * sizeof (char));
> extra.c-325- strcpy (ret, buf);
not testing. I thought about theses lines and some others.

-- 
Fabien Seisen seisenlinuxfr.org http://seisen.linuxfr.org dakolIRCNET



This archive was generated by hypermail 2b27 : Fri Jan 21 2000 - 19:45:34 CST