Skip to content

Commit fc7648b

Browse files
committed
Fix copilot feedback and address remaining issues
1 parent 169a5df commit fc7648b

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/mqtt_broker.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ static int BrokerWsNetWrite(void* context, const byte* buf, int buf_len,
10251025

10261026
/* Check if the write callback reported an error (it frees tx_pending
10271027
* and sets status to -1 before returning -1 to lws) */
1028-
if (ws->status <= 0) {
1028+
if (ws->status < 0) {
10291029
return MQTT_CODE_ERROR_NETWORK;
10301030
}
10311031

@@ -3867,7 +3867,8 @@ int MqttBroker_Start(MqttBroker* broker)
38673867
broker->port != broker->port_tls) {
38683868
WBLOG_ERR(broker,
38693869
"broker: WARNING: auth credentials exposed on plaintext "
3870-
"port %d. Use --disable-broker-insecure for TLS-only",
3870+
"port %d. Rebuild with ./configure --disable-broker-insecure "
3871+
"for TLS-only",
38713872
broker->port);
38723873
}
38733874
#endif

wolfmqtt/mqtt_types.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,11 @@ enum MqttPacketResponseCodes {
362362
* from optimizing away the stores (dead-store elimination). */
363363
static INLINE void Mqtt_ForceZero(void* mem, word32 len)
364364
{
365-
volatile byte* z = (volatile byte*)mem;
366-
while (len--) *z++ = 0;
365+
volatile byte* p = (volatile byte*)mem;
366+
word32 i;
367+
for (i = 0; i < len; i++) {
368+
p[i] = 0;
369+
}
367370
}
368371

369372
/* Logging / Tracing */

0 commit comments

Comments
 (0)