mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-24 11:25:30 +00:00
Fix mxmlSaveString with a 0-length buffer (Issue #284)
This commit is contained in:
parent
bd4eb861a7
commit
3a4ece2266
@ -1,6 +1,7 @@
|
||||
# Changes in Mini-XML 3.2.1
|
||||
|
||||
- Fixed potential memory leak in `mxmlLoad*` functions (Issue #278, Issue #279)
|
||||
- Fixed `mxmlSaveString` with a buffer size of 0 (Issue #284)
|
||||
- Fixed `MXML_MINOR_VERSION` value in "mxml.h" (Issue #285)
|
||||
- Fixed POSIX threading support for MingW (Issue #287)
|
||||
- Fixed some minor memory leaks found by Coverity.
|
||||
|
@ -376,7 +376,10 @@ mxmlSaveString(mxml_node_t *node, /* I - Node to write */
|
||||
*/
|
||||
|
||||
if (ptr[0] >= ptr[1])
|
||||
buffer[bufsize - 1] = '\0';
|
||||
{
|
||||
if (bufsize > 0)
|
||||
buffer[bufsize - 1] = '\0';
|
||||
}
|
||||
else
|
||||
ptr[0][0] = '\0';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user