mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
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).
This commit is contained in:
@ -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>
|
2019-09-03 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
PR 24958
|
PR 24958
|
||||||
|
@ -253,7 +253,9 @@ get_indirect_operand (unsigned short fragment,
|
|||||||
for (i = 0, bufcnt = 0; i < len; i++, bufcnt++)
|
for (i = 0, bufcnt = 0; i < len; i++, bufcnt++)
|
||||||
{
|
{
|
||||||
buffer[bufcnt] = current_ind->syntax[i];
|
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';
|
buffer[++bufcnt] = arnum + '0';
|
||||||
if (buffer[bufcnt] == '('
|
if (buffer[bufcnt] == '('
|
||||||
&& current_ind->displacement == DISP_REQUIRED)
|
&& current_ind->displacement == DISP_REQUIRED)
|
||||||
|
Reference in New Issue
Block a user