summaryrefslogtreecommitdiff
path: root/libs/pthreads/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-16 20:49:30 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-16 20:49:30 +0300
commitb322b86a999d3bf82860066fbf6fda00619136fe (patch)
tree9d5d2d19d9fa9faea47c089f8ef813f11ce9147e /libs/pthreads/src
parent41a5dbf4d9d937b5fe9df3c700e8c43c82f2343c (diff)
some additional checks
Diffstat (limited to 'libs/pthreads/src')
-rw-r--r--libs/pthreads/src/pthread_mutex_trylock.c4
-rw-r--r--libs/pthreads/src/pthread_mutex_unlock.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/libs/pthreads/src/pthread_mutex_trylock.c b/libs/pthreads/src/pthread_mutex_trylock.c
index d6b68724db..5728728b62 100644
--- a/libs/pthreads/src/pthread_mutex_trylock.c
+++ b/libs/pthreads/src/pthread_mutex_trylock.c
@@ -64,6 +64,10 @@ pthread_mutex_trylock (pthread_mutex_t * mutex)
}
mx = *mutex;
+ if (mx == NULL) {
+ return EINVAL;
+ }
+
kind = mx->kind;
if (kind >= 0)
diff --git a/libs/pthreads/src/pthread_mutex_unlock.c b/libs/pthreads/src/pthread_mutex_unlock.c
index 3d65d1a957..77175bb5da 100644
--- a/libs/pthreads/src/pthread_mutex_unlock.c
+++ b/libs/pthreads/src/pthread_mutex_unlock.c
@@ -50,6 +50,9 @@ pthread_mutex_unlock (pthread_mutex_t * mutex)
*/
mx = *mutex;
+ if (mx == NULL) {
+ return EINVAL;
+ }
/*
* If the thread calling us holds the mutex then there is no