[PATCH] Fix 2 possible SEGVs in tftp client

Bernhard Fischer rep.nop at aon.at
Wed Jun 14 10:30:58 PDT 2006


On Tue, Jun 13, 2006 at 08:30:52AM -0700, Erik Hovland wrote:
>On Tue, Jun 13, 2006 at 09:28:47AM -0500, Jason Schoon wrote:
>> --- busybox/networking/tftp.c	2006-06-13 09:26:45.000000000 -0500
>> +++ busybox/networking/tftp.c.mine	2006-06-13 09:26:11.000000000 -0500
>> @@ -95,7 +95,7 @@
>>  	return blocksize;
>>  }
>>  
>> -static char *tftp_option_get(char *buf, int len, const char const *option)
>> +static char *tftp_option_get(char *buf, int len, char const *option)
>
>You could write this as:
>static char *tftp_option_get(char *buf, int len, const char *const option)
>
>The const in the right place would allow the compiler to further
>optimize the case where both the dereferenced string and the pointer to
>the string are not changed in the function that they are being passed
>to. Not sure if that adds to a real space savings.
>
>See my post and patch to utils.c and utils.h where I did this for
>another function:
>http://busybox.net/lists/busybox/2006-June/022287.html

Applied.
Typo of mine, sorry for any inconvenience this may have caused.
cheers,


More information about the busybox mailing list