[BusyBox] patch for working modprobe under both 2.4 and 2.6 kernels :)
Niklas Höglund
niklas.hoglund at telia.com
Tue Aug 3 15:03:39 UTC 2004
Anders Eriksson wrote:
>> /* last path component */
>> const char *last_comp = strrchr (mod_path, '/');
>>+ const char *mod_ext = ".o";
>>+
>>+#if defined(CONFIG_FEATURE_2_6_MODULES)
>>+ if ( k_version > 4 )
>>+ mod_ext = ".ko";
>>+#endif
>>
>>
>>
>
>
>Doesn't this lengthening of the string essentially constitute a buffer
>overflow? I guess you could do it the other way around (define to .ko,
>and shrink to .o).
>
>
No. It would have if he had done "strcpy (mod_ext, ".ko")", but now he
only changes the pointer mod_ext from pointing at the statically
allocated string ".o" to pointing at the statically allocated string ".ko".
More information about the busybox
mailing list