Horms wrote:
> On Mon, Dec 11, 2006 at 06:01:10PM +0530, Sachin P. Sant wrote:
>   
>> The correct place should be after the strncmp() call.
>>
>> Something like the attached patch.
>>     
>
> Good point. Could you provide a signed-off-by line ?
>   
Didn't i include that? Sorry. Here it is 

Signed-off-by : Sachin Sant <[EMAIL PROTECTED]>

Thanks
-Sachin

>   
>> diff -Naurp b/kexec/arch/ppc64/fs2dt.c a/kexec/arch/ppc64/fs2dt.c
>> --- b/kexec/arch/ppc64/fs2dt.c       2006-12-11 06:47:36.000000000 -0600
>> +++ a/kexec/arch/ppc64/fs2dt.c       2006-12-11 06:51:20.000000000 -0600
>> @@ -108,7 +108,7 @@ static unsigned propnum(const char *name
>>  static void add_usable_mem_property(int fd, int len)
>>  {
>>      char fname[MAXPATH], *bname;
>> -    char buf[MAXBYTES +1];
>> +    unsigned long long buf[2];
>>      unsigned long ranges[2*MAX_MEMORY_RANGES];
>>      unsigned long long base, end, loc_base, loc_end;
>>      int range, rlen = 0;
>> @@ -120,6 +120,10 @@ static void add_usable_mem_property(int
>>      if (strncmp(bname, "/memory@", 8))
>>              return;
>>
>> +    if (len < 2 * sizeof(unsigned long long))
>> +            die("unrecoverable error: not enough data for mem property\n");
>> +    len = 2 * sizeof(unsigned long long);
>> +
>>      if (lseek(fd, 0, SEEK_SET) < 0)
>>              die("unrecoverable error: error seeking in \"%s\": %s\n",
>>                  pathname, strerror(errno));
>>     

_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to