[PATCH] Fix 2 possible SEGVs in tftp client

Bernhard Fischer rep.nop at aon.at
Sat Jun 10 14:21:16 UTC 2006


On Sat, Jun 10, 2006 at 03:24:10PM +0200, Bernhard Fischer wrote:
>On Mon, Apr 24, 2006 at 03:26:48PM -0500, Jason Schoon wrote:
>>On 4/22/06, Bernhard Fischer <rep.nop at aon.at> wrote:
>>>
>>> The attached patch takes Jason's and Horst's patches, cleans up the
>>> style (simple ident with the default style) and removes some cruft
>>> (which was optimized away by my compiler anyway, but just did look
>>> wrong) and also removes some stuff which did add to the size without any
>>> apparent benefit (the cached cmd_{get,put} adds just bloat for me).
>>>
>>> Not yet finished, missing bits:
>>> - check for argv[optind + 1 == NULL
>>> - see if there is opportunity to make tftp() smaller.
>>> - peruse USE_
>>> - see if perusing ENABLE_ in the code (not the cpp) is a good idea,
>>>   size-wise
>>>
>>> Could someone elaborate on why that fileno() call was there?
>>>
>>> Completely untested so far..
>>>
>>> I'll come back and ask folks to test this when i'm done looking over
>>> the todo list above (unless somebody beats me to it, of course :)
>>> No numbers since it's not yet finished..
>>
>>
>>Here is an updated patch.  First, I realized I had my file cleanup code in
>>the wrong place.  It should be called unconditionally, not in
>>FEATURE_CLEANUP.  I then went through and cleaned up some more of the code a
>>bit, removing useless comments and magic numbers as best I could.  I did not
>>yet try to shrink tftp() or switch to the ENABLE_ macros.
>
>I'm currently looking at opportunities to shrink it a bit (on top of our
>cummulative 04 patch).

Applied as http://busybox.net/cgi-bin/viewcvs.cgi?rev=15355&view=rev I
think I didn't damaged it too much..
Thanks to anyone who was involved.
cheers,
Bernhard



More information about the busybox mailing list