[SSSD] [PATCH] SYSDB: NULL-terminate the output of sysdb_get_{ranges, subdomains}

Pavel Březina pbrezina at redhat.com
Mon Sep 10 08:26:57 UTC 2012


On 09/10/2012 10:22 AM, Jakub Hrozek wrote:
> On Mon, Sep 10, 2012 at 09:19:49AM +0200, Pavel Březina wrote:
>> On 09/09/2012 09:31 PM, Jakub Hrozek wrote:
>>> I noticed (using valgrind) that the sysdb tests access memory outside
>>> the array allocated as a result of the functions in subject. The attached
>>> patch NULL-terminates the array so that it's safe to loop over the results.
>>
>> Nack. Just a nitpick :-)
>>
>>> -    list = talloc_zero_array(tmp_ctx, struct range_info *, res->count);
>>> +    list = talloc_zero_array(tmp_ctx, struct range_info *, res->count+1);
>>
>> Can you add spaces around + please? They are present in the other
>> function.
>>
>> Thanks,
>> Pavel.
>
> Sure, attached.

Ack.



More information about the sssd-devel mailing list