[OpenBIOS] [PATCH 1/2] Fix NULL-dereferencing in sunparts_open
Artyom Tarasenko
atar4qemu at gmail.com
Sat Apr 6 19:42:40 CEST 2013
On Sat, Apr 6, 2013 at 7:34 PM, Mark Cave-Ayland
<mark.cave-ayland at ilande.co.uk> wrote:
> On 06/04/13 02:57, Artyom Tarasenko wrote:
>
>> Signed-off-by: Artyom Tarasenko<atar4qemu at gmail.com>
>> ---
>> packages/sun-parts.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/packages/sun-parts.c b/packages/sun-parts.c
>> index 2ee9613..272f7c0 100644
>> --- a/packages/sun-parts.c
>> +++ b/packages/sun-parts.c
>> @@ -109,7 +109,7 @@ sunparts_open( sunparts_info_t *di )
>> [(id)][,][filespec]
>> */
>>
>> - if ( strlen(str) ) {
>> + if ( str && strlen(str) ) {
>>
>> /* Detect the arguments */
>> if ((*str>= '0'&& *str<= '9') || (*str>= 'a'&& *str<
>> ('a' + 8)) || (*str == ',')) {
>> push_str(str);
>
>
> Thanks - this is a similar bug to the one that was in mac-parts.c so I've
> applied it.
I've found it after applying the patch preventing mapping of the page
0 and looking what breaks.
It may be a good idea not to map the page 0 on other architectures too.
More information about the OpenBIOS
mailing list