apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: [PATCH] apr_pstrndup() doc tweak
Date Tue, 31 Oct 2006 12:36:54 GMT
On Tue, Oct 31, 2006 at 07:25:48AM -0500, Jeff Trawick wrote:
> Context: Code review of a third-party Apache module related
> coincidentally to chronic memory corruption problems found a blunder
> in code ported from Apache 1.3 to Apache 2.0+APR.  It assumed that
> apr_pstrndup(), like ap_pstrndup(), always allocated n+1 bytes from
> the pool (i.e., it actually reused n+1 bytes of the returned string).


> But the two functions differ in that respect, and apr_pstrndup()
> documentation isn't as explicit as it could be.
> Concerns with the following tweaks, or better ideas?

My pet nit, NUL != NULL... maybe have the remark:

"The amount of memory allocated from the pool is the length of the
returned string including the NUL terminator"

and may as well capitalise that Duplicate at the beginning :)


View raw message