diff options
author | wtc%netscape.com <devnull@localhost> | 2001-06-05 23:55:55 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2001-06-05 23:55:55 +0000 |
commit | acbbe4d860f1d84d541aedd1728578fbae68f68d (patch) | |
tree | 6f980f74c3057716e01e58e18237b0a7c80def1e | |
parent | 64dc7e40ab3aed7b13938bcd4be5c1e2d31ebd33 (diff) | |
download | nspr-hg-acbbe4d860f1d84d541aedd1728578fbae68f68d.tar.gz |
Bugzilla bug #82436: assert that lock is not NULL in PR_Lock and PR_Unlock
to avoid crashing in an assertion statement like
PR_ASSERT(lock->owner != me) if lock is NULL.
-rw-r--r-- | pr/src/threads/combined/prulock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pr/src/threads/combined/prulock.c b/pr/src/threads/combined/prulock.c index c28194e6..054f8e53 100644 --- a/pr/src/threads/combined/prulock.c +++ b/pr/src/threads/combined/prulock.c @@ -230,6 +230,7 @@ PR_IMPLEMENT(void) PR_Lock(PRLock *lock) #if !defined(XP_MAC) PR_ASSERT(!(me->flags & _PR_IDLE_THREAD)); #endif + PR_ASSERT(lock != NULL); #ifdef _PR_GLOBAL_THREADS_ONLY PR_ASSERT(lock->owner != me); _PR_MD_LOCK(&lock->ilock); @@ -336,6 +337,7 @@ PR_IMPLEMENT(PRStatus) PR_Unlock(PRLock *lock) PRIntn is; PRThread *me = _PR_MD_CURRENT_THREAD(); + PR_ASSERT(lock != NULL); PR_ASSERT(lock->owner == me); PR_ASSERT(me != suspendAllThread); #if !defined(XP_MAC) |