summaryrefslogtreecommitdiff
path: root/lib/atomic.h
diff options
context:
space:
mode:
authorTom Vrancken <email@tomvrancken.nl>2017-08-25 19:54:58 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-08-26 08:46:01 +0200
commit72d25d427078d3de5c25c3b5406b0313ffd813ab (patch)
tree39718802bf1df7733b4cfa69d13432bd71ecc7fc /lib/atomic.h
parentca969496016c76ef3cdc556e02506042b389c038 (diff)
downloadgnutls-72d25d427078d3de5c25c3b5406b0313ffd813ab.tar.gz
Fixed segmentation faults caused by accessing NULL pointers during mutex operations. This bug was triggered while setting priorities.
Signed-off-by: Tom Vrancken <email@tomvrancken.nl>
Diffstat (limited to 'lib/atomic.h')
-rw-r--r--lib/atomic.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/atomic.h b/lib/atomic.h
index 3e943a81b8..f07a71a110 100644
--- a/lib/atomic.h
+++ b/lib/atomic.h
@@ -47,24 +47,24 @@ typedef struct gnutls_atomic_uint_st *gnutls_atomic_uint_t;
inline static unsigned gnutls_atomic_val(gnutls_atomic_uint_t x)
{
unsigned int t;
- gnutls_mutex_lock(x->lock);
+ gnutls_mutex_lock(&x->lock);
t = x->value;
- gnutls_mutex_unlock(x->lock);
+ gnutls_mutex_unlock(&x->lock);
return t;
}
inline static void gnutls_atomic_increment(gnutls_atomic_uint_t x)
{
- gnutls_mutex_lock(x->lock);
+ gnutls_mutex_lock(&x->lock);
x->value++;
- gnutls_mutex_unlock(x->lock);
+ gnutls_mutex_unlock(&x->lock);
}
inline static void gnutls_atomic_decrement(gnutls_atomic_uint_t x)
{
- gnutls_mutex_lock(x->lock);
+ gnutls_mutex_lock(&x->lock);
x->value--;
- gnutls_mutex_unlock(x->lock);
+ gnutls_mutex_unlock(&x->lock);
}
inline static void gnutls_atomic_init(gnutls_atomic_uint_t x)