From patchwork Wed Oct 10 09:32:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 29691 Received: (qmail 91319 invoked by alias); 10 Oct 2018 09:32:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 91153 invoked by uid 89); 10 Oct 2018 09:32:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Oct 2018 09:32:46 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F3C6030820C1 for ; Wed, 10 Oct 2018 09:32:44 +0000 (UTC) Received: from blade.nx (ovpn-117-250.ams2.redhat.com [10.36.117.250]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE86C83899 for ; Wed, 10 Oct 2018 09:32:44 +0000 (UTC) Received: from blade.com (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id F157D80B0904 for ; Wed, 10 Oct 2018 10:32:43 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH] Add missing va_end found by Coverity Date: Wed, 10 Oct 2018 10:32:41 +0100 Message-Id: <1539163961-7279-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes Hi all, This commit adds a missing va_end found by Coverity. Built and regtested on RHEL 7.5 x86_64. Ok to commit? Thanks, Gary --- gdb/ChangeLog: * remote.c (remote_target::remote_send_printf): Add missing va_end found by Coverity. --- gdb/ChangeLog | 5 +++++ gdb/remote.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/remote.c b/gdb/remote.c index 724f41c..c53553a 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -8938,7 +8938,11 @@ remote_target::remote_send_printf (const char *format, ...) va_start (ap, format); rs->buf[0] = '\0'; - if (vsnprintf (rs->buf, max_size, format, ap) >= max_size) + int size = vsnprintf (rs->buf, max_size, format, ap); + + va_end (ap); + + if (size >= max_size) internal_error (__FILE__, __LINE__, _("Too long remote packet.")); if (putpkt (rs->buf) < 0)