In OCStack.c OCGetHeaderOption code (master branch):

   for (size_t i = 0; i < numOptions; i++)
    {
        if (ocHdrOpt[i].optionID == optionID)
        {
  /*BUG?*/          if (optionDataLength >= ocHdrOpt->optionLength)
            {
                memcpy(optionData, ocHdrOpt[i].optionData,
ocHdrOpt[i].optionLength);
                *receivedDataLength = ocHdrOpt[i].optionLength;
                return OC_STACK_OK;
... etc...

Shouldn't the line marked BUG read:

        if (optionDataLength >= ocHdrOpt[i]->optionLength)

(Note that "optionDataLength" refers to the size of the output buffer.)

Gregg

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10144): 
https://lists.iotivity.org/g/iotivity-dev/message/10144
Mute This Topic: https://lists.iotivity.org/mt/29342744/21656
Group Owner: iotivity-dev+ow...@lists.iotivity.org
Unsubscribe: https://lists.iotivity.org/g/iotivity-dev/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to