libfcgi icon indicating copy to clipboard operation
libfcgi copied to clipboard

Assertion in fcgiapp.c:82 will fail in most cases

Open avistel opened this issue 9 years ago • 1 comments

ASSERT(size == 0 || result != NULL);

Won't this assertion fail when you try to allocate anything more than 0 bytes? Shouldn't it be ASSERT(size != 0 || result != NULL)?

If this is intentional, can you explain why?

avistel avatar Oct 14 '16 00:10 avistel

Having looked at it again, as long as malloc returns a valid pointer, the assertion passes. I guess the only way this assertion would not work properly is if given size == 0, malloc returns a non-zero pointer. Not sure if that's something worth worrying about... is it?

avistel avatar Oct 14 '16 03:10 avistel