mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-21 00:07:36 +08:00
Fixed crash on wine by adding NULL check after memchr
This is not a joke, there are vendors out there who build software for cygwin only. Besides, this NULL check is good to have anyway.
This commit is contained in:
parent
7b6414d459
commit
4ddf5903fd
@ -4307,6 +4307,8 @@ find_fast_cwd_pointer ()
|
||||
const uint8_t *use_cwd = rcall + 5 + offset;
|
||||
/* Find first `push %edi' instruction. */
|
||||
const uint8_t *pushedi = (const uint8_t *) memchr (use_cwd, 0x57, 32);
|
||||
if (!pushedi)
|
||||
return NULL;
|
||||
/* ...which should be followed by `mov crit-sect-addr,%edi' then
|
||||
`push %edi', or by just a single `push crit-sect-addr'. */
|
||||
const uint8_t *movedi = pushedi + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user