diff options
author | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2016-05-19 18:02:51 +0000 |
---|---|---|
committer | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2016-05-19 18:02:51 +0000 |
commit | 1985a2d4dd5c40128d8ab3517b2003535b0c8acb (patch) | |
tree | 0950d7143fb5fdc8ec8e48c102c954cedfb68a1b | |
parent | 73a3b8d612963d2892cf381c8f18a0e8dd71a279 (diff) | |
download | pcre-1985a2d4dd5c40128d8ab3517b2003535b0c8acb.tar.gz |
A racing condition is fixed in JIT reported by Mozilla.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1647 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | sljit/sljitUtils.c | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -79,6 +79,8 @@ Version 8.39 xx-xxxxxx-201x that certain errors, provoked by the SSE2 instruction set when JIT is used, are ignored. +20. A racing condition is fixed in JIT reported by Mozilla. + Version 8.38 23-November-2015 ----------------------------- diff --git a/sljit/sljitUtils.c b/sljit/sljitUtils.c index 6bd17e5..ec5c321 100644 --- a/sljit/sljitUtils.c +++ b/sljit/sljitUtils.c @@ -182,7 +182,10 @@ static pthread_mutex_t dev_zero_mutex = PTHREAD_MUTEX_INITIALIZER; static SLJIT_INLINE sljit_s32 open_dev_zero(void) { pthread_mutex_lock(&dev_zero_mutex); - dev_zero = open("/dev/zero", O_RDWR); + /* The dev_zero might be initialized by another thread during the waiting. */ + if (dev_zero < 0) { + dev_zero = open("/dev/zero", O_RDWR); + } pthread_mutex_unlock(&dev_zero_mutex); return dev_zero < 0; } |