This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Allocation buffers for NSS result construction
- From: DJ Delorie <dj at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 15 May 2017 19:32:49 -0400
- Subject: Re: [PATCH] Allocation buffers for NSS result construction
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dj at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6760A8046F
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6760A8046F
I have no specific comments on this, it looks pretty good and I like the
idea of centralizing this (I just did something similar in the NSS
testsuite, could have used this). I mostly focused on the allocation
routines; I'm not familiar with resolv yet.
I do worry about having "internal" (internal to the allocator, not
internal to glibc) functions in a header. They're written as if they'll
never be called by "outsiders" (i.e. little argument checking) but
there's no protection against such calls. I don't know how to add such
protection, though.
Not having a pointer to the buffer's beginning irked me a bit, but I
don't see any reason to include it anyway.
I would recommend a few comments defining the behavior if NULL is passed
as a thing to copy - the NSS testsuite needed to preserve such
"mistakes" in the test data.
I wonder if this new functionality is complex enough to warrant a
separate bit of documentation? Either in the manual or elsewhere...
The reallocarray patch also includes a __check_mul_overflow_size_t style
function; this duplication will need to be resolved as patches get
committed.