From 9be9e26b74e4a8cf5798f1937662ac5f2f2f1f58 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 22 Mar 2018 13:10:40 +0100 Subject: [PATCH] util: buffer: Tolerate NULL 'buf' in virBufferStrcat Most other buffer APIs tolerate the buffer being NULL. Signed-off-by: Peter Krempa --- 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); -- GitLab