On Oct 27, 2011, at 4:21 PM, Stefan Fritsch wrote: > > That's correct, it would crash if len == APR_SIZE_MAX. But my point > was that it would also crash for len == APR_SIZE_MAX-1000, because by > definition, the machine cannot have that much free mem and apr_pcalloc > would call abort(). So in both cases, the amount of free memory is the > limit. But aborting with out-of-mem is more correct than simply > segfaulting, therefore I have fixed it.
Worrying about what the machine would do and what the code would do are 2 different things. The code is obviously broken should len == APR_SIZE_MAX, no matter whether or not the machine allows it or not, and that is, imo, unacceptable.
