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

Pavel Březina pbrezina at redhat.com
Mon Sep 10 07:19:49 UTC 2012


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.



More information about the sssd-devel mailing list