Reserve byte for NUL terminator and report errors consistently in xmlBuf and xmlBuffer
requested to merge ddkilzer/reserve-NUL-termiantor-and-report-errors-consistently-in-xmlBuf-xmlBuffer into master
This is a follow-up to commit 6c283d83.
- buf.c: (xmlBufGrowInternal):
- Call xmlBufMemoryError() when the buffer size would overflow.
- Account for NUL terminator byte when using XML_MAX_TEXT_LENGTH.
- Do not include NUL terminator byte when returning length. (xmlBufAdd):
- Call xmlBufMemoryError() when the buffer size would overflow.
- tree.c: (xmlBufferGrow):
- Call xmlTreeErrMemory() when the buffer size would overflow.
- Do not include NUL terminator byte when returning length. (xmlBufferResize):
- Update error message in xmlTreeErrMemory() to be consistent with other similar messages. (xmlBufferAdd):
- Call xmlTreeErrMemory() when the buffer size would overflow. (xmlBufferAddHead):
- Add overflow checks similar to those in xmlBufferAdd().
Edited by David Kilzer