You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "Viipuri, Timo" <ti...@f-secure.com> on 2005/07/07 10:42:20 UTC

[PATCH] NULL checking in apr_bucket_alloc() and socket_bucket_read()

Hi,

We have had some problems with APR-util crashing in apr_bucket_alloc() under
low memory circumstances. The problem has been the calls to
apr_allocator_alloc() returning NULL if it can't allocate memory. Currently,
the return value is not checked for NULL and the program crashes.

I suggest the following two simple patches to solve this problem. If NULL is
returned by one of the calls to apr_allocator_alloc() the function
socket_bucket_read() will return with error condition: APR_ENOMEM.

What do you think?

 Timo