Fix a wrong calculation of buffer size to make coap options
authorJihun Ha <jihun.ha@samsung.com>
Tue, 4 Apr 2017 02:32:32 +0000 (11:32 +0900)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Thu, 6 Apr 2017 16:33:23 +0000 (16:33 +0000)
commitd944868cf009cc052f73543c5fa6d36869be8551
tree552b966a32257acf6ef4a06531efcd0449b0be0e
parent2ffa80b538d6bd87b0374a797f151261f603e8fd
Fix a wrong calculation of buffer size to make coap options

A 'buflen' variable produced by coap_split_query has a meaning of
remained buffer size after filling a set of coap query options to pBuf which
has CA_MAX_URI_LENGTH(512) size.
It means option data is filled upto pBuf + (CA_MAX_URI_LENGTH - buflen).
Thus, accessing pBuf can reach to the above location.

Change-Id: I1320531730800a57e78e4bc56552c51525903468
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18363
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
resource/csdk/connectivity/src/caprotocolmessage.c [changed mode: 0644->0755]