public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Fix buffer underrun bug in the TI C30 disassembler.
Date: Tue, 03 Sep 2019 15:14:00 -0000	[thread overview]
Message-ID: <f44b758d3133ef0a7f3131c1e12ed20feb33ee61@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT f44b758d3133ef0a7f3131c1e12ed20feb33ee61 ***

commit f44b758d3133ef0a7f3131c1e12ed20feb33ee61
Author:     Nick Clifton <nickc@redhat.com>
AuthorDate: Tue Sep 3 15:37:12 2019 +0100
Commit:     Nick Clifton <nickc@redhat.com>
CommitDate: Tue Sep 3 15:37:12 2019 +0100

    Fix buffer underrun bug in the TI C30 disassembler.
    
            PR 24961
            * tic30-dis.c (get_indirect_operand): Check for bufcnt being
            greater than zero before indexing via (bufcnt -1).

diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 87e3f74663..64b6a07ac4 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+2019-09-03  Nick Clifton  <nickc@redhat.com>
+
+	PR 24961
+	* tic30-dis.c (get_indirect_operand): Check for bufcnt being
+	greater than zero before indexing via (bufcnt -1).
+
 2019-09-03  Nick Clifton  <nickc@redhat.com>
 
 	PR 24958
diff --git a/opcodes/tic30-dis.c b/opcodes/tic30-dis.c
index c64aceb29f..668c519df8 100644
--- a/opcodes/tic30-dis.c
+++ b/opcodes/tic30-dis.c
@@ -253,7 +253,9 @@ get_indirect_operand (unsigned short fragment,
 		for (i = 0, bufcnt = 0; i < len; i++, bufcnt++)
 		  {
 		    buffer[bufcnt] = current_ind->syntax[i];
-		    if (buffer[bufcnt - 1] == 'a' && buffer[bufcnt] == 'r')
+		    if (bufcnt > 0
+			&& buffer[bufcnt - 1] == 'a'
+			&& buffer[bufcnt] == 'r')
 		      buffer[++bufcnt] = arnum + '0';
 		    if (buffer[bufcnt] == '('
 			&& current_ind->displacement == DISP_REQUIRED)


             reply	other threads:[~2019-09-03 14:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 15:14 gdb-buildbot [this message]
2019-09-03 15:15 ` Failures on Ubuntu-Aarch64-m64, branch master gdb-buildbot
2019-09-03 15:18 ` Failures on Debian-s390x-native-extended-gdbserver-m64, " gdb-buildbot
2019-09-03 15:18 ` Failures on RHEL-s390x-m64, " gdb-buildbot
2019-09-03 15:21 ` Failures on Fedora-i686, " gdb-buildbot
2019-09-03 15:33 ` Failures on Debian-s390x-m64, " gdb-buildbot
2019-09-03 15:41 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2019-09-03 15:58 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2019-09-03 16:02 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-09-03 16:33 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2019-09-03 16:33 ` Failures on Debian-s390x-native-gdbserver-m64, " gdb-buildbot
2019-09-03 16:34 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-09-03 16:43 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2019-09-03 16:47 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot

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=f44b758d3133ef0a7f3131c1e12ed20feb33ee61@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).