Fix SVACE DEREF_OF_NULL.RET.PROC.STAT 90/261290/1
authorJaechul Lee <jcsing.lee@samsung.com>
Thu, 15 Jul 2021 01:27:15 +0000 (10:27 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Thu, 15 Jul 2021 01:27:15 +0000 (10:27 +0900)
[Version] 0.0.10
[Issue Type] SVACE

Change-Id: Ifde946e93c9f44e0d9a34289b128d04ddd220057
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
packaging/hal-api-audio.spec
testcase/parser.cpp

index 958b69c7d0a30dfe2789388671d5aea918f0c4b7..6b660bacaa32fe7a9bf121d22614ed1f19ca853f 100644 (file)
@@ -1,6 +1,6 @@
 Name:       hal-api-audio
 Summary:    TIZEN Audio HAL
-Version:    0.0.9
+Version:    0.0.10
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index e22a95085538a0a4f854ea6ba70c7e442035b4e0..cc49b6e3833ab53af0c4dc16791197beb55eb2c9 100644 (file)
@@ -218,7 +218,9 @@ void CDeviceMapParser::parse_device_role_object(json_object *device_role_o, stri
        it_end = json_object_iter_end(device_role_o);
 
        while (!json_object_iter_equal(&it, &it_end)) {
-               if (strcmp(json_object_iter_peek_name(&it), "normal") == 0) {
+               const char *name = json_object_iter_peek_name(&it);
+
+               if (name && !strcmp(name, "normal")) {
                        device_params.assign(json_object_get_string(json_object_iter_peek_value(&it)));
                        cout << "      " << DEVICE_TYPE_PROP_ROLE << " : {  normal : " << device_params << " }" << endl;
                        break;