[IOT-1133] Fix size setting for CA URI buffer
authorInga Stotland <inga.stotland@intel.com>
Wed, 29 Jun 2016 06:15:33 +0000 (23:15 -0700)
committerAshok Babu Channa <ashok.channa@samsung.com>
Fri, 1 Jul 2016 04:28:51 +0000 (04:28 +0000)
Use common define CA_MAX_URI_SIZE instead of hardcoded magic number

Change-Id: I61f6f39d1646166be92775e25419c1749f946c76
Signed-off-by: Inga Stotland <inga.stotland@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9019
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/connectivity/src/caprotocolmessage.c

index ff2ff13..03eca3b 100644 (file)
@@ -45,7 +45,6 @@
 
 #define TAG "OIC_CA_PRTCL_MSG"
 
-#define CA_BUFSIZE (128)
 #define CA_PDU_MIN_SIZE (4)
 #define CA_ENCODE_BUFFER_SIZE (4)
 
@@ -447,7 +446,7 @@ CAResult_t CAParseUriPartial(const unsigned char *str, size_t length, int target
     }
     else if (str && length)
     {
-        unsigned char uriBuffer[CA_BUFSIZE] = { 0 };
+        unsigned char uriBuffer[CA_MAX_URI_LENGTH] = { 0 };
         unsigned char *pBuf = uriBuffer;
         size_t buflen = sizeof(uriBuffer);
         int res = (target == COAP_OPTION_URI_PATH) ? coap_split_path(str, length, pBuf, &buflen) :