@@ -441,8 +441,9 @@ int MqttEncode_Props(MqttPacketType packet, MqttProp* props, byte* buf)
441441 }
442442 case MQTT_DATA_TYPE_STRING :
443443 {
444- tmp = MqttEncode_String (buf ,
445- (const char * )cur_prop -> data_str .str );
444+ tmp = MqttEncode_Data (buf ,
445+ (const byte * )cur_prop -> data_str .str ,
446+ cur_prop -> data_str .len );
446447 rc += tmp ;
447448 if (buf != NULL ) {
448449 buf += tmp ;
@@ -475,15 +476,17 @@ int MqttEncode_Props(MqttPacketType packet, MqttProp* props, byte* buf)
475476 {
476477 /* String is prefixed with a Two Byte Integer length field that
477478 gives the number of bytes */
478- tmp = MqttEncode_String (buf ,
479- (const char * )cur_prop -> data_str .str );
479+ tmp = MqttEncode_Data (buf ,
480+ (const byte * )cur_prop -> data_str .str ,
481+ cur_prop -> data_str .len );
480482 rc += tmp ;
481483 if (buf != NULL ) {
482484 buf += tmp ;
483485 }
484486
485- tmp = MqttEncode_String (buf ,
486- (const char * )cur_prop -> data_str2 .str );
487+ tmp = MqttEncode_Data (buf ,
488+ (const byte * )cur_prop -> data_str2 .str ,
489+ cur_prop -> data_str2 .len );
487490 rc += tmp ;
488491 if (buf != NULL ) {
489492 buf += tmp ;
@@ -2681,9 +2684,9 @@ int MqttProps_Init(void)
26812684 int ret = MQTT_CODE_SUCCESS ;
26822685#if !defined(WOLFMQTT_DYN_PROP ) && defined(WOLFMQTT_MULTITHREAD )
26832686 if (clientPropStack_lockInit == 0 ) {
2684- clientPropStack_lockInit ++ ;
26852687 ret = wm_SemInit (& clientPropStack_lock );
26862688 }
2689+ clientPropStack_lockInit ++ ;
26872690#endif
26882691 return ret ;
26892692}
0 commit comments