[patch] abuse of strncpy

Erik Hovland erik at hovland.org
Wed Jun 7 14:49:10 UTC 2006


On Wed, Jun 07, 2006 at 10:26:49AM -0400, Mike Frysinger wrote:
> On Thursday 01 June 2006 19:00, Erik Hovland wrote:
> > --- networking/tftp.c???(revision 15261)
> > +++ networking/tftp.c???(working copy)
> > @@ -172,7 +172,10 @@
> > ????????len = sizeof(sa);
> > ?
> > ????????memset(&sa, 0, len);
> > -???????bind(socketfd, (struct sockaddr *)&sa, len);
> > +???????if (bind(socketfd, (struct sockaddr *)&sa, len) < 0) {
> > +???????????????bb_perror_msg("bind");
> > +???????????????return EXIT_FAILURE;
> > +???????}
> > ?
> > ????????sa.sin_family = host->h_addrtype;
> > ????????sa.sin_port = port;
> 
> what does this have to do with strncpy() ?

Heh, it doesn't. I accidentally slipped in some patches that were to
correct calls to functions which return values but are not checked.

My latest post on patches attempts to address all of the fixes so that
there isn't confusion like this. Sorry for the sloppiness.

E

-- 
Erik Hovland
mail: erik at hovland.org
web: http://hovland.org/
PGP/GPG public key available on request



More information about the busybox mailing list