diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-02 19:16:10 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-02 19:16:10 +0200 |
commit | 7a5065ecfee46c77ace6db55b8c3c19933ae659d (patch) | |
tree | 13d2c2c55352af9e2f8419faf300ba2903dc68ac /lib/locks.c | |
parent | 557368ad3afbe8d247aa79737d888d53afaf2264 (diff) | |
download | gnutls-7a5065ecfee46c77ace6db55b8c3c19933ae659d.tar.gz |
Do not allow setting NULL lock functions
Diffstat (limited to 'lib/locks.c')
-rw-r--r-- | lib/locks.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/locks.c b/lib/locks.c index c017fc1686..c758d80c06 100644 --- a/lib/locks.c +++ b/lib/locks.c @@ -173,6 +173,9 @@ mutex_unlock_func gnutls_mutex_unlock = gnutls_system_mutex_unlock; void gnutls_global_set_mutex(mutex_init_func init, mutex_deinit_func deinit, mutex_lock_func lock, mutex_unlock_func unlock) { + if (init == NULL || deinit == NULL || lock == NULL || unlock == NULL) + return; + gnutls_mutex_init = init; gnutls_mutex_deinit = deinit; gnutls_mutex_lock = lock; |