Explorar o código

pthread_mutex_unlock: Return EINVAL when given NULL mutex

Jeremy Soller %!s(int64=6) %!d(string=hai) anos
pai
achega
0fd936b4d4
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      pthread_mutex_unlock.c

+ 4 - 0
pthread_mutex_unlock.c

@@ -60,6 +60,10 @@ pthread_mutex_unlock (pthread_mutex_t * mutex)
   /*
    * Let the system deal with invalid pointers.
    */
+  if (*mutex == NULL)
+    {
+      return EINVAL;
+    }
 
   mx = *mutex;