mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-12 16:58:16 +03:00
malloc-fail: Fix use-after-free in xmlBufBackToBuffer
This commit is contained in:
parent
edbf1eb63b
commit
9c2d451c02
11
buf.c
11
buf.c
@ -863,12 +863,19 @@ xmlBufBackToBuffer(xmlBufPtr buf) {
|
||||
if (buf == NULL)
|
||||
return(NULL);
|
||||
CHECK_COMPAT(buf)
|
||||
if ((buf->error) || (buf->buffer == NULL)) {
|
||||
ret = buf->buffer;
|
||||
|
||||
if ((buf->error) || (ret == NULL)) {
|
||||
xmlBufFree(buf);
|
||||
if (ret != NULL) {
|
||||
ret->content = NULL;
|
||||
ret->contentIO = NULL;
|
||||
ret->use = 0;
|
||||
ret->size = 0;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
ret = buf->buffer;
|
||||
/*
|
||||
* What to do in case of error in the buffer ???
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user