[PATCH] Fix 2 possible SEGVs in tftp client

Jason Schoon floydpink at gmail.com
Fri Apr 21 14:46:13 UTC 2006


On 4/21/06, KRONSTORFER Horst <Horst.KRONSTORFER at frequentis.com> wrote:
>
> hi!
>
> attached patch fixes 2 possible segfaults in tftp.c:
>
> 1) when both -l and -r are omitted, a null pointer is passed for
> 'remotefile'
> to tftp() which doesn't expect a null pointer for this argument.
>
> 2) when hostname/ipaddr is omitted, a null pointer is passed for 'name'
> to gethostbyname() (via xgethostbyname()) which doesn't expect a null
> pointer for this argument.
>
> Looks great, I submitted a patch that never got applied for #1 last year,
but I hadn't even run into #2.  I would suggest whoever applies this also
remove the worthless comment:

/* XXX: argv[optind] and/or argv[optind + 1] may be NULL! */

(Gotta love when people comment the bad condition, rather than just check
for it).

Attached is another patch I submitted last year that I would like to see
applied to TFTP.  Currently if a transfer fails, TFTP leaves around a bogus
file.  This patch removes it on failure.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20060421/a5c89983/attachment-0002.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox_tftp_remove_file.patch
Type: text/x-patch
Size: 513 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060421/a5c89983/attachment.bin 


More information about the busybox mailing list