resolved the bug related to the address parsing
authorhyuna0213.jo <hyuna0213.jo@samsung.com>
Mon, 3 Aug 2015 06:54:35 +0000 (15:54 +0900)
committerErich Keane <erich.keane@intel.com>
Tue, 4 Aug 2015 05:57:36 +0000 (05:57 +0000)
If user is enter the address for the unicast message,
we are parsing the input value in get_address_set() function.
I modified the get_address_set() function, because there are bugs
in this process. currently linux sample app code is not working.

Change-Id: Id0d0cfbabd2b91c4c18ec0ed28593495a2e2a75e
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2055
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/connectivity/samples/linux/sample_main.c

index a5792d5..fa35518 100644 (file)
@@ -1576,11 +1576,13 @@ bool get_address_set(const char *pAddress, addressSet_t* outAddress)
     {
         if(ipLen && ipLen < sizeof(outAddress->ipAddress))
         {
-            OICStrcpy(outAddress->ipAddress, sizeof(outAddress->ipAddress), pAddress);
+            OICStrcpyPartial(outAddress->ipAddress, sizeof(outAddress->ipAddress),
+                             pAddress, ipLen);
         }
         else if (!ipLen && len < sizeof(outAddress->ipAddress))
         {
-            OICStrcpy(outAddress->ipAddress, sizeof(outAddress->ipAddress), pAddress);
+            OICStrcpyPartial(outAddress->ipAddress, sizeof(outAddress->ipAddress),
+                             pAddress, len);
         }
         else
         {