Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] ofwboot bootp/bootparams mixup



Christos Zoulas wrote:
> In article <49FEC7F2.1070708%marples.name@localhost>,
>>              }
>> -            if (tag == TAG_ROOTPATH) {
>> +            if (tag == TAG_ROOTPATH && size <= sizeof(rootpath)) {
>>                      strncpy(rootpath, (char *)cp, sizeof(rootpath));
>>                      rootpath[size] = '\0';
>>              }
>> -            if (tag == TAG_HOSTNAME) {
>> +            if (tag == TAG_HOSTNAME && size <= sizeof(hostname)) {
>>                      strncpy(hostname, (char *)cp, sizeof(hostname));
>>                      hostname[size] = '\0';
> 
> The <= test should really be < I think.

Yes, good catch.

> Also why the printf changes...
> I don't mind them, but others might.

Simply because the information overflowed the right of my screen, which
is something I intensely dislike - if something can fit on one line then
it should try to :)

But that's just me.

Thanks

Roy


Home | Main Index | Thread Index | Old Index