dascandy / hippomocks

GNU Lesser General Public License v2.1
196 stars 67 forks source link

Hippomock can crash tests due to incorrect restoring functions #101

Closed y0lo closed 5 years ago

y0lo commented 5 years ago
  1. If the tested function is less than 16 bytes and is not aligned.
  2. A nearby function (the beginning of the next function is located with the following address) is tested. Result: In the backup will be copied replaced instruction and will be incorrectly restored. Next native call of the function will cause "segmentation fault".

Fix: https://github.com/dascandy/hippomocks/pull/99 Solution: The restoring of functions must be done in back order.

Maybe the container "list" could be replaced to "stack".

dascandy commented 5 years ago

Hi,

Your pull request was merged. Does this fully fix this issue?

y0lo commented 5 years ago

Fixed.