qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v2 2/4] qemu-nbd: initialize progname with error_set


From: Hitoshi Mitake
Subject: [Qemu-devel] [PATCH v2 2/4] qemu-nbd: initialize progname with error_set_progname()
Date: Thu, 22 Jan 2015 18:08:12 +0900

Calling error_get_progname() in the context of qemu-nbd can cause
segmentation fault because qemu-nbd 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 qemu-nbd doesn't use error_get_progname(). This patch
is a proactive action.

Cc: Paolo Bonzini <address@hidden>
Cc: Markus Armbruster <address@hidden>
Signed-off-by: Hitoshi Mitake <address@hidden>
---
 qemu-nbd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qemu-nbd.c b/qemu-nbd.c
index d222512..fad5634 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -449,6 +449,7 @@ int main(int argc, char **argv)
     sa_sigterm.sa_handler = termsig_handler;
     sigaction(SIGTERM, &sa_sigterm, NULL);
     qemu_init_exec_dir(argv[0]);
+    error_set_progname(argv[0]);
 
     while ((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
         switch (ch) {
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]