[PATCH v2 4/4] util: Check for negative indent in virBufferAdd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/util/virbuffer.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c
index 969dcbf..693e4b2 100644
--- a/src/util/virbuffer.c
+++ b/src/util/virbuffer.c
@@ -153,10 +153,9 @@ virBufferAdd(virBufferPtr buf, const char *str, int len)
     if (!str || !buf || (len == 0 && buf->indent == 0))
         return;
 
-    if (buf->error)
-        return;
-
     indent = virBufferGetIndent(buf, true);
+    if (indent < 0)
+        return;
 
     if (len < 0)
         len = strlen(str);
-- 
1.7.11.7

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]