Menu

#149 SourceUri and DestinationUri don't with 32 characters

1.3.2.0
closed
None
2017-03-02
2017-02-27
No

According to IEC 61375-2-1 a STRING32 is a 0 terminated character-array. If the STRING32 contains 32 character it is NOT 0 terminated anymore.

Since TRDP_MAX_URI_USER_LEN is currently set to 32, maximum 31 characters will be copied with the following code:

vos_strncpy(pNewElement->destURI, destURI, TRDP_MAX_URI_USER_LEN - 1);

In order to make sure that DestUri and SourceUri can contain up to 32 characters and that they are not 0 terminated if 32 characters are used, the whole code must be reviewed.

Unfortunately in the IEC 61375-2-3 the SourceUri and DestinationUri are only described a 0 terminated string in a CHAR[32]. According to the string definition in IEC 61375-2-1 (see above), the string is not 0 terminated if it contains the maximum number of characters.

If sending MD-messages, the DestiUri and SourceUri can contain 32 character and are not 0 terminated, if using the maximum number of characters.

Discussion

  • Bernd Löhr

    Bernd Löhr - 2017-03-01
    • status: open --> accepted
    • assigned_to: Bernd Löhr
     
  • Bernd Löhr

    Bernd Löhr - 2017-03-01

    The array size of types TRDP_URI_HOST_T and TRDP_URI_USER_T need to be enlarged to hold 32 characters + 1 (trailing EOS). Care has to be taken when reading/writing the packet header: Conversion between UINT8[32] array and internal strings.

     
  • Bernd Löhr

    Bernd Löhr - 2017-03-02
    • status: accepted --> pending
     
  • Bernd Löhr

    Bernd Löhr - 2017-03-02

    Fixed to allow 32 characters in header, local arrays are 33 byte wide now.

     
  • Bernd Löhr

    Bernd Löhr - 2017-03-02
    • Status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB