[PATCH 01/11] util: buffer: Tolerate NULL 'buf' in virBufferStrcat

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

 



Most other buffer APIs tolerate the buffer being NULL.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/util/virbuffer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c
index 1a6bf122e0..3d6defb73a 100644
--- a/src/util/virbuffer.c
+++ b/src/util/virbuffer.c
@@ -883,6 +883,9 @@ virBufferStrcat(virBufferPtr buf, ...)
 {
     va_list ap;

+    if (!buf)
+        return;
+
     va_start(ap, buf);
     virBufferStrcatVArgs(buf, ap);
     va_end(ap);
-- 
2.16.2

--
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]

  Powered by Linux