public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] ubsan: crx: index 5 out of bounds for type 'operand_desc const[5]'
@ 2019-12-26  9:40 gdb-buildbot
  2019-12-26  9:52 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master gdb-buildbot
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gdb-buildbot @ 2019-12-26  9:40 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 100b122fc125bdf1fe768a3331a0cd413c3d1261 ***

commit 100b122fc125bdf1fe768a3331a0cd413c3d1261
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Thu Dec 26 16:04:20 2019 +1030
Commit:     Alan Modra <amodra@gmail.com>
CommitDate: Thu Dec 26 17:49:03 2019 +1030

    ubsan: crx: index 5 out of bounds for type 'operand_desc const[5]'
    
            * crx-dis.c (get_number_of_operands): Don't access operands[]
            out of bounds.

diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 07f30e27d6..25c29b235c 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-26  Alan Modra  <amodra@gmail.com>
+
+	* crx-dis.c (get_number_of_operands): Don't access operands[]
+	out of bounds.
+
 2019-12-26  Alan Modra  <amodra@gmail.com>
 
 	* v850-dis.c (disassemble): Avoid signed overflow.  Don't use
diff --git a/opcodes/crx-dis.c b/opcodes/crx-dis.c
index 3834748616..e44fca1111 100644
--- a/opcodes/crx-dis.c
+++ b/opcodes/crx-dis.c
@@ -105,7 +105,7 @@ get_number_of_operands (void)
 {
   int i;
 
-  for (i = 0; instruction->operands[i].op_type && i < MAX_OPERANDS; i++)
+  for (i = 0; i < MAX_OPERANDS && instruction->operands[i].op_type; i++)
     ;
 
   return i;


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-12-26 12:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-26  9:40 [binutils-gdb] ubsan: crx: index 5 out of bounds for type 'operand_desc const[5]' gdb-buildbot
2019-12-26  9:52 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master gdb-buildbot
2019-12-26 11:18 ` Failures on Fedora-i686, " gdb-buildbot
2019-12-26 11:22 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-12-26 11:26 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2019-12-26 11:49 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-12-26 11:55 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2019-12-26 11:58 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2019-12-26 12:01 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2019-12-26 22:45 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

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).