소스 검색

pthread_mutex_unlock: Return EINVAL when given NULL mutex

Jeremy Soller 6 년 전
부모
커밋
0fd936b4d4
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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;