kazuho/picohttpparser — pull request #2 by KrishnaPG (2014-06-12 06:09:06+00:00)
Title: Added low_memory error (to indicate no. of headers supplied is not sufficient)

Please consider merging this modification: It tries to provide more useful information to the caller about the case where the parser fails due to the supplied header array not being sufficient.

This will greatly help adjusting the header-array size (if required) or identify any denial-of-service / overflow kind of attacks.

The code uses #defines (only inside the .c file) to easily identify the semantics of errors. Please feel free to change the macro names, if required. Also, the header file comment is updated to include this new error number.

Error number -3 is used for this. So, this should not break compatibility with existing codes built on top of this.

Thank you for the great work and providing this library.

- GK (Gopalakrishna)

http://gk.palem.in/