Add assert check for hash_func before use 78/96578/1
authorSeungbae Shin <seungbae.shin@samsung.com>
Tue, 8 Nov 2016 12:26:55 +0000 (21:26 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Wed, 9 Nov 2016 10:45:12 +0000 (02:45 -0800)
[Version] 5.0.99
[Profile] Common
[Issue Type] Exception check

Change-Id: Iebb59d3197c8af0eecf592cb054ea705d71662d1
(cherry picked from commit 5d90591ed93a36c54a7e52a6a30442a3d825cc44)

packaging/pulseaudio.spec
src/pulsecore/hashmap.c

index 052eae1..7ff355b 100644 (file)
@@ -11,7 +11,7 @@
 Name:             pulseaudio
 Summary:          Improved Linux sound server
 Version:          5.0
-Release:          98
+Release:          99
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
 URL:              http://pulseaudio.org
index 2cc03cb..384f16b 100644 (file)
@@ -138,6 +138,9 @@ int pa_hashmap_put(pa_hashmap *h, void *key, void *value) {
     unsigned hash;
 
     pa_assert(h);
+#ifdef __TIZEN__
+    pa_assert(h->hash_func);
+#endif
 
     hash = h->hash_func(key) % NBUCKETS;
 
@@ -180,6 +183,9 @@ void* pa_hashmap_get(pa_hashmap *h, const void *key) {
     struct hashmap_entry *e;
 
     pa_assert(h);
+#ifdef __TIZEN__
+    pa_assert(h->hash_func);
+#endif
 
     hash = h->hash_func(key) % NBUCKETS;
 
@@ -195,6 +201,9 @@ void* pa_hashmap_remove(pa_hashmap *h, const void *key) {
     void *data;
 
     pa_assert(h);
+#ifdef __TIZEN__
+    pa_assert(h->hash_func);
+#endif
 
     hash = h->hash_func(key) % NBUCKETS;