diff mbox

[v2,3/4] qga: initialize progname with error_set_progname()

Message ID 1421917694-6824-4-git-send-email-mitake.hitoshi@lab.ntt.co.jp
State New
Headers show

Commit Message

Hitoshi Mitake Jan. 22, 2015, 9:08 a.m. UTC
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 <mdroth@linux.vnet.ibm.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
---
 qga/main.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

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();