Skip to contentSkip to conversation

target-ppc/int_helper.c: 2 * bad array index

Qemu-devel dcb 3 participants 6 messages Nov 21, 2016 – Jan 16, 2017

lore
Share & tools
lore

dcb

author
#0 lore raw

Public bug reported:

1.

[qemu/target-ppc/int_helper.c:2575]: (error) Array 'reg.u16[8]' accessed at index 8, which is out of bounds.

Source code is

   return reg->u16[8 - n];

and

qemu/target-ppc/cpu.h: uint16_t u16[8];

but at least once, n is zero, for example line 2725 in the int_helper.c file:

    uint16_t sgnb = get_national_digit(b, 0);

2.

[qemu/target-ppc/int_helper.c:2584]: (error) Array 'reg.u16[8]' accessed at index 8, which is out of bounds.

Duplicate

** Affects: qemu
Importance: Undecided
Status: New

Signature · 38 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1643537

Title:
  target-ppc/int_helper.c: 2 * bad array index

Status in QEMU:
  New

Bug description:
  1.

  [qemu/target-ppc/int_helper.c:2575]: (error) Array 'reg.u16[8]'
  accessed at index 8, which is out of bounds.

  Source code is

     return reg->u16[8 - n];

  and

  qemu/target-ppc/cpu.h:    uint16_t u16[8];

  but at least once, n is zero, for example line 2725 in the
  int_helper.c file:

      uint16_t sgnb = get_national_digit(b, 0);

  2.

  [qemu/target-ppc/int_helper.c:2584]: (error) Array 'reg.u16[8]'
  accessed at index 8, which is out of bounds.

  Duplicate

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1643537/+subscriptions
#1 lore raw
Quoted 11 lines · dcb

Public bug reported:

1.

[qemu/target-ppc/int_helper.c:2575]: (error) Array 'reg.u16[8]' accessed at index 8, which is out of bounds.

Source code is

   return reg->u16[8 - n];
Quoted 8 lines

and

qemu/target-ppc/cpu.h: uint16_t u16[8];

but at least once, n is zero, for example line 2725 in the int_helper.c file:

    uint16_t sgnb = get_national_digit(b, 0);

That looks wrong, indeed. I guess it should be "7 - n" instead of "8 - n"? Jose, could you please have a look at this?

Thomas

#2 lore raw
Quoted 19 lines · Thomas Huth
Quoted 18 lines · dcb

Public bug reported:

1.

[qemu/target-ppc/int_helper.c:2575]: (error) Array 'reg.u16[8]' accessed at index 8, which is out of bounds.

Source code is

   return reg->u16[8 - n];

and

qemu/target-ppc/cpu.h: uint16_t u16[8];

but at least once, n is zero, for example line 2725 in the int_helper.c file:

Quoted 7 lines
Quoted 1 line
    uint16_t sgnb = get_national_digit(b, 0);

That looks wrong, indeed. I guess it should be "7 - n" instead of "8 - n"? Jose, could you please have a look at this?

Thomas

Hello Thomas,

Just sent a patch to address it.

Thanks for letting me know it.

Ziviani

#3 lore raw
In reply to dcb

Thanks for the bug report! Jose posted a patch:
marc.info/[email protected]

** Changed in: qemu
Status: New => Confirmed

Signature · 38 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1643537

Title:
  target-ppc/int_helper.c: 2 * bad array index

Status in QEMU:
  Confirmed

Bug description:
  1.

  [qemu/target-ppc/int_helper.c:2575]: (error) Array 'reg.u16[8]'
  accessed at index 8, which is out of bounds.

  Source code is

     return reg->u16[8 - n];

  and

  qemu/target-ppc/cpu.h:    uint16_t u16[8];

  but at least once, n is zero, for example line 2725 in the
  int_helper.c file:

      uint16_t sgnb = get_national_digit(b, 0);

  2.

  [qemu/target-ppc/int_helper.c:2584]: (error) Array 'reg.u16[8]'
  accessed at index 8, which is out of bounds.

  Duplicate

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1643537/+subscriptions
#4 lore raw
In reply to dcb

Fix has been committed:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=a813fe73621e1221a09

** Changed in: qemu
Status: Confirmed => Fix Committed

Signature · 38 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1643537

Title:
  target-ppc/int_helper.c: 2 * bad array index

Status in QEMU:
  Fix Committed

Bug description:
  1.

  [qemu/target-ppc/int_helper.c:2575]: (error) Array 'reg.u16[8]'
  accessed at index 8, which is out of bounds.

  Source code is

     return reg->u16[8 - n];

  and

  qemu/target-ppc/cpu.h:    uint16_t u16[8];

  but at least once, n is zero, for example line 2725 in the
  int_helper.c file:

      uint16_t sgnb = get_national_digit(b, 0);

  2.

  [qemu/target-ppc/int_helper.c:2584]: (error) Array 'reg.u16[8]'
  accessed at index 8, which is out of bounds.

  Duplicate

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1643537/+subscriptions
#5 lore raw
In reply to dcb

Released with version 2.8

** Changed in: qemu
Status: Fix Committed => Fix Released

Signature · 38 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1643537

Title:
  target-ppc/int_helper.c: 2 * bad array index

Status in QEMU:
  Fix Released

Bug description:
  1.

  [qemu/target-ppc/int_helper.c:2575]: (error) Array 'reg.u16[8]'
  accessed at index 8, which is out of bounds.

  Source code is

     return reg->u16[8 - n];

  and

  qemu/target-ppc/cpu.h:    uint16_t u16[8];

  but at least once, n is zero, for example line 2725 in the
  int_helper.c file:

      uint16_t sgnb = get_national_digit(b, 0);

  2.

  [qemu/target-ppc/int_helper.c:2584]: (error) Array 'reg.u16[8]'
  accessed at index 8, which is out of bounds.

  Duplicate

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1643537/+subscriptions