← Commit list

87149c8383

x2018
x2018
2025-11-10
SUCCESS Duration: 143s

Subject

mqtt: properly handle the message which exceeds maxsize

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/mqtt.c+4 -2
@@ -613,8 +613,10 @@ static CURLcode mqtt_publish(struct Curl_easy *data)
remaininglength = payloadlen + 2 + topiclen;
encodelen = mqtt_encode_len(encodedbytes, remaininglength);
- if(MAX_MQTT_MESSAGE_SIZE - remaininglength - 1 < encodelen)
- return CURLE_TOO_LARGE;
+ if(MAX_MQTT_MESSAGE_SIZE - remaininglength - 1 < encodelen) {
+ result = CURLE_TOO_LARGE;
+ goto fail;
+ }
/* add the control byte and the encoded remaining length */
pkt = malloc(remaininglength + 1 + encodelen);