Calling error_get_progname() in the context of qga can cause
segmentation fault because qga doesn't initialize its progname
with error_set_progname(). This patch adds the initialization.

Currently, the missing call of error_set_progname() doesn't cause any
problems because qga doesn't use error_get_progname(). This patch
is a proactive action.

Cc: Michael Roth <mdr...@linux.vnet.ibm.com>
Cc: Markus Armbruster <arm...@redhat.com>
Signed-off-by: Hitoshi Mitake <mitake.hito...@lab.ntt.co.jp>
---
 qga/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qga/main.c b/qga/main.c
index 9939a2b..0885fc6 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -958,6 +958,7 @@ int main(int argc, char **argv)
     GList *blacklist = NULL;
     GAState *s;
 
+    error_set_progname(argv[0]);
     module_call_init(MODULE_INIT_QAPI);
 
     init_dfl_pathnames();
-- 
1.9.1


Reply via email to