public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Fixed crash on wine by adding NULL check after memchr
@ 2020-01-13 15:35 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2020-01-13 15:35 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4ddf5903fd24feaa6f75ffb12f9cafdd266b386a
commit 4ddf5903fd24feaa6f75ffb12f9cafdd266b386a
Author: Arseniy Lartsev <arseniy@alumni.chalmers.se>
Date: Tue Jan 7 16:34:39 2020 +0100
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.
Diff:
---
winsup/cygwin/path.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index b5efd61..c8e73c6 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-01-13 15:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 15:35 [newlib-cygwin] Fixed crash on wine by adding NULL check after memchr Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).