Reported-by: Jiyong Yang
Closes #19415
return result;
}
+#define MAX_MQTT_MESSAGE_SIZE 0xFFFFFFF
+
static CURLcode mqtt_publish(struct Curl_easy *data)
{
CURLcode result;
remaininglength = payloadlen + 2 + topiclen;
encodelen = mqtt_encode_len(encodedbytes, remaininglength);
+ if(MAX_MQTT_MESSAGE_SIZE - remaininglength - 1 < encodelen)
+ return CURLE_TOO_LARGE;
/* add the control byte and the encoded remaining length */
pkt = malloc(remaininglength + 1 + encodelen);