From patchwork Thu Jan 22 09:08:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hitoshi Mitake X-Patchwork-Id: 431731 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7C0271402A1 for ; Thu, 22 Jan 2015 20:09:53 +1100 (AEDT) Received: from localhost ([::1]:51883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEDlv-0003yH-Aa for incoming@patchwork.ozlabs.org; Thu, 22 Jan 2015 04:09:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEDlQ-00034v-0o for qemu-devel@nongnu.org; Thu, 22 Jan 2015 04:09:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEDlJ-0006HH-Em for qemu-devel@nongnu.org; Thu, 22 Jan 2015 04:09:19 -0500 Received: from mail-pd0-x22f.google.com ([2607:f8b0:400e:c02::22f]:56405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEDlI-0006GB-TD for qemu-devel@nongnu.org; Thu, 22 Jan 2015 04:09:13 -0500 Received: by mail-pd0-f175.google.com with SMTP id fl12so541843pdb.6 for ; Thu, 22 Jan 2015 01:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=kqpvYMbu9NYVAzP5sNQcwsoUiFOF3g4ILP1rELPCW60=; b=Qwf8WtEu+acrlqGNVI6dnqbGEHSP5f7kbDvWVrVCtnkxQydGve3/KLw7fpmQgmHZ3u Q3InjLJqjrcs8Z4Tz505nbYWvR/FnH5ubPMJGGMKnDguU7Bbf3KQk6DFS1SpZC58iGK7 foL0kgMKTBsW5+6txY4D0x9aWo0kldu/KqxIjv03vgt0gpSuUDFFDoV8MarJl/s/5Sss yyQZvBpkjl/sNUUy+U+DjKzPSLh62unNzOnJMcSVwnOhYx1M5ZzWQ6xpqaOPvJK9RPWN 5dazdqUeidcoeMR/+Ky/jAfpmJkQu880xDcUk27X+e4We58NtrW1YcITelRD+a81SuMI Lqcw== X-Received: by 10.70.91.49 with SMTP id cb17mr431744pdb.35.1421917752316; Thu, 22 Jan 2015 01:09:12 -0800 (PST) Received: from localhost.localdomain (p12167-ipngn4801marunouchi.tokyo.ocn.ne.jp. [153.160.163.167]) by mx.google.com with ESMTPSA id ka5sm8265357pbc.27.2015.01.22.01.09.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Jan 2015 01:09:11 -0800 (PST) From: Hitoshi Mitake To: qemu-devel@nongnu.org Date: Thu, 22 Jan 2015 18:08:12 +0900 Message-Id: <1421917694-6824-3-git-send-email-mitake.hitoshi@lab.ntt.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421917694-6824-1-git-send-email-mitake.hitoshi@lab.ntt.co.jp> References: <1421917694-6824-1-git-send-email-mitake.hitoshi@lab.ntt.co.jp> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::22f Cc: Hitoshi Mitake , Paolo Bonzini , Markus Armbruster , mitake.hitoshi@gmail.com Subject: [Qemu-devel] [PATCH v2 2/4] qemu-nbd: initialize progname with error_set_progname() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Cc: Markus Armbruster Signed-off-by: Hitoshi Mitake --- 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) {