IOT-2223: Fix build break.
authorSoemin Tjong <stjong@microsoft.com>
Mon, 8 May 2017 23:42:55 +0000 (16:42 -0700)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Thu, 11 May 2017 09:59:01 +0000 (09:59 +0000)
https://jira.iotivity.org/browse/IOT-2223

Use strlen instead of strnlen_s.

Change-Id: I11e837da3d9e31e092093732f48f72b4171319a4
Signed-off-by: Soemin Tjong <stjong@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19731
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
resource/IPCA/src/ocfframework.cpp

index d908969..f5751af 100644 (file)
@@ -1719,10 +1719,13 @@ void OCFFramework::RequestAccessWorkerThread(RequestAccessContext* requestContex
                                         passwordInputCallbackInfo);
                         }
 
+                        // Make sure user input string is terminated
+                        passwordBuffer[OXM_PRECONFIG_PIN_MAX_SIZE] = '\0';
+
                         // Set the preconfigured pin
                         result = deviceDetails->securityInfo.device->addPreconfigPIN(
                                         passwordBuffer,
-                                        strnlen_s(passwordBuffer, passwordBufferSize));
+                                        strlen(passwordBuffer));
 
                         if (OC_STACK_OK != result)
                         {