Fixed svace & coverity issues. 42/213342/1 accepted/tizen/unified/20190904.224506 submit/tizen/20190904.113521
authorsaerome.kim <saerome.kim@samsung.com>
Wed, 4 Sep 2019 07:53:33 +0000 (16:53 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Wed, 4 Sep 2019 08:57:59 +0000 (17:57 +0900)
- Coverity
1079311: check_return: Calling ua_user_get_account without checking return value.

- Svace
406760: INVARIANT_RESULT.OP_ZERO

Change-Id: I52d347f6430aa08846da5aec674b35cd30786108
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
packaging/capi-network-ua.spec
src/user-awareness-device.c
test/uat-init.c

index 6d4171ef1f91f23bc96da4c5f84fc3edfc97ade6..86a624c32f08d1103f9309b2262e967cbc23585f 100644 (file)
@@ -1,6 +1,6 @@
 Name: capi-network-ua
 Summary: User Awareness Framework CAPI
-Version: 0.7.1
+Version: 0.7.2
 Release: 1
 License: Apache-2.0
 Source0: %{name}-%{version}.tar.gz
index 5c0e4f7a114cfc1b6a86c2728824a87359f64edc..4912777988acb3d540fa80c492009dda5c425a58 100644 (file)
@@ -524,7 +524,7 @@ int ua_device_set_os_info(
 
        retv_if(device->isadded, UA_ERROR_INVALID_PARAMETER);
 
-       if (os < UA_OS_TYPE_NOT_DEFINE || os > UA_OS_TYPE_IOS) {
+       if (os > UA_OS_TYPE_IOS) {
                /* LCOV_EXCL_START */
                UA_ERR("Invalid os type");
                return UA_ERROR_INVALID_PARAMETER;
index c4fc14f518eb95e7d6aca6c5fb90151e8cf6f7e8..75603192cd3cb53442bc051971d602ec0fd7ff2e 100644 (file)
@@ -41,13 +41,18 @@ static char g_ibeacon_adv_str[MENU_DATA_SIZE + 1] = {0,}; /**< iBeacon advertisi
 static void __user_absence_detected_cb(int result, ua_monitor_h monitor,
                ua_user_h user_handle, void *user_data)
 {
+       int ret;
        char *account = NULL;
        char *pbuf = uat_get_time();
 
        msg("\n[%s]", pbuf);
        free(pbuf);
 
-       ua_user_get_account(user_handle, &account);
+       ret = ua_user_get_account(user_handle, &account);
+       if (UA_ERROR_NONE != ret) {
+               msg(" - ua_user_get_account() ret: [0x%X] [%s]",
+                       ret, uat_get_error_str(ret));
+       }
        msgp("[%s] ABSENCE detected [%s]", account, uat_get_error_str(result));
 
        if (account) {