Fix potentially illegal shift and assign operation in CSKY disassembler.
authorNick Clifton <nickc@redhat.com>
Mon, 28 Oct 2019 16:45:55 +0000 (16:45 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 28 Oct 2019 16:45:55 +0000 (16:45 +0000)
* csky-dis.c (csky_chars_to_number): Check for a negative
count. Use an unsigned integer to construct the return value.

opcodes/ChangeLog
opcodes/csky-dis.c

index 8489b4078823c0fb2491087c6d8fdb3a8242bcbd..5f5a6c869b1b1fece7ee768edd8496871bc3533b 100644 (file)
@@ -1,3 +1,8 @@
+2019-10-28  Nick Clifton  <nickc@redhat.com>
+
+       * csky-dis.c (csky_chars_to_number): Check for a negative
+       count. Use an unsigned integer to construct the return value.
+
 2019-10-28  Nick Clifton  <nickc@redhat.com>
 
        * tic30-dis.c (OPERAND_BUFFER_LEN): Define.  Use as length of
index efd1f75052b341664c2fb3d0d738256d398578d6..ffdb59649586a6c6ff391bc1be82e7c18d0e778a 100644 (file)
@@ -134,10 +134,10 @@ csky_get_mask (struct csky_opcode_info const *pinfo)
 static unsigned int
 csky_chars_to_number (unsigned char * buf, int n)
 {
-  if (n == 0)
+  if (n <= 0)
     abort ();
   int i;
-  int val = 0;
+  unsigned int val = 0;
 
   if (dis_info.info->endian == BFD_ENDIAN_BIG)
     while (n--)
This page took 0.025654 seconds and 4 git commands to generate.