https://bugs.kde.org/show_bug.cgi?id=381162

            Bug ID: 381162
           Summary: array overrun in VEX register allocator
           Product: valgrind
           Version: 3.13 SVN
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: vex
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

In function doRegisterAllocation(), array "reg_usage_arr" is currently
allocated with:
    LibVEX_Alloc_inline(sizeof(HRegUsage) * instrs_in->arr_used - 1).

However I think this is wrong.
It should be allocated with:
    LibVEX_Alloc_inline(sizeof(HRegUsage) * instrs_in->arr_used);

That's because rreg_usage_arr is indexed with [0 .. arr_used-1] so its length
needs to be at least arr_used (and not arr_used-1).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to