]> code.delx.au - pulseaudio/commitdiff
dbus: Add assertions to get rid of warnings from Coverity.
authorTanu Kaskinen <tanu.kaskinen@digia.com>
Wed, 28 Mar 2012 11:47:20 +0000 (14:47 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 28 Mar 2012 14:34:19 +0000 (17:34 +0300)
Coverity thinks that expected_method_sig can be NULL when
it's dereferenced by pa_streq(). Adding assertions doesn't
hurt here (in my opinion), and that should get rid of the
warnings.

src/pulsecore/protocol-dbus.c

index 03cebc1ea1c4d17c7ce199f011806d01315c54ce..adc1f38d3f009b57dac3dc782b674866babb6e8a 100644 (file)
@@ -360,7 +360,7 @@ static enum find_result_t find_handler_by_method(struct call_info *call_info) {
 
     PA_HASHMAP_FOREACH(call_info->iface_entry, call_info->obj_entry->interfaces, state) {
         if ((call_info->method_handler = pa_hashmap_get(call_info->iface_entry->method_handlers, call_info->method))) {
-            call_info->expected_method_sig = pa_hashmap_get(call_info->iface_entry->method_signatures, call_info->method);
+            pa_assert_se(call_info->expected_method_sig = pa_hashmap_get(call_info->iface_entry->method_signatures, call_info->method));
 
             if (pa_streq(call_info->method_sig, call_info->expected_method_sig))
                 return FOUND_METHOD;
@@ -469,7 +469,7 @@ static enum find_result_t find_handler(struct call_info *call_info) {
             return NO_SUCH_INTERFACE;
 
         else if ((call_info->method_handler = pa_hashmap_get(call_info->iface_entry->method_handlers, call_info->method))) {
-            call_info->expected_method_sig = pa_hashmap_get(call_info->iface_entry->method_signatures, call_info->method);
+            pa_assert_se(call_info->expected_method_sig = pa_hashmap_get(call_info->iface_entry->method_signatures, call_info->method));
 
             if (!pa_streq(call_info->method_sig, call_info->expected_method_sig))
                 return INVALID_METHOD_SIG;