From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Add missing va_end found by Coverity
Date: Wed, 10 Oct 2018 09:32:00 -0000 [thread overview]
Message-ID: <1539163961-7279-1-git-send-email-gbenson@redhat.com> (raw)
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)
--
1.8.3.1
next reply other threads:[~2018-10-10 9:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-10 9:32 Gary Benson [this message]
2018-10-10 13:01 ` Tom Tromey
2018-10-10 14:06 ` Gary Benson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1539163961-7279-1-git-send-email-gbenson@redhat.com \
--to=gbenson@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox