diff options
author | Nishant Chaprana <n.chaprana@samsung.com> | 2019-10-07 18:05:44 +0530 |
---|---|---|
committer | saerome.kim <saerome.kim@samsung.com> | 2019-10-08 09:55:15 +0900 |
commit | 1454939eaa7bacb6f9eb1f05489b95585dc7045a (patch) | |
tree | f11de024fd2a55cd364073757ae27e7f6dac9b0a | |
parent | ac4d7c30c8084d43a0d133d3002d976bae677569 (diff) | |
download | user-awareness-1454939eaa7bacb6f9eb1f05489b95585dc7045a.tar.gz user-awareness-1454939eaa7bacb6f9eb1f05489b95585dc7045a.tar.bz2 user-awareness-1454939eaa7bacb6f9eb1f05489b95585dc7045a.zip |
Add NULL check before g_strlcpy operation in ua_user_remove_device()submit/tizen/20191008.005850accepted/tizen/unified/20191008.101535
The ua_user_remove_device() returns INVALID_PARAMETER error
when both device_id and mac are NULL.
However when device_id is only NULL and mac is not NULL
then Glib warning will be generated.
Change-Id: I26a21db9659866d3e1a2e6ded9722e9897e958d9
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
-rw-r--r-- | src/user-awareness-users.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/user-awareness-users.c b/src/user-awareness-users.c index 53d08a3..0e4ea15 100644 --- a/src/user-awareness-users.c +++ b/src/user-awareness-users.c @@ -894,7 +894,8 @@ int ua_user_remove_device(ua_user_h user_handle, ua_device_h device_handle) if (device->mac) g_strlcpy(uam_device.mac, device->mac, UAM_MAC_ADDRESS_STRING_LEN); - g_strlcpy(uam_device.device_id, device->device_id, UA_MOBILE_ID_STRING_LEN); + if (device->device_id) + g_strlcpy(uam_device.device_id, device->device_id, UA_MOBILE_ID_STRING_LEN); if (device->ipv4) g_strlcpy(uam_device.ipv4_addr, device->ipv4, UA_IPV4_ADDRESS_STRING_LEN); |