[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] dnsmasq: Fix parsing of the version number



On 12/06/2012 07:39 AM, Michal Privoznik wrote:
> On 06.12.2012 13:29, Laine Stump wrote:
>> On 12/06/2012 06:34 AM, Michal Privoznik wrote:
>>  
>> -    p = STRSKIP(buf, DNSMASQ_VERSION_STR);
>> -    if (!p)
>> +    if (!(p = strstr(buf, DNSMASQ_VERSION_STR)))
>>         goto fail;
>> +    p += sizeof(DNSMASQ_VERSION_STR) - 1;
>> Why -1 ? That happens to work, but wouldn't if the version string didn't
>> end with a space.
> sizeof(const char[]) counts '\0' at the end. We don't want that here.

Right. I was caffeineless and saw that as strlen instead of sizeof :-)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]