mirror of
https://github.com/curl/curl.git
synced 2026-04-20 12:01:13 +03:00
mqtt: better too-big-message-check
Reported-by: gudyuu on hackerone Reviewed-by: Daniel Gustafsson Bug: https://hackerone.com/reports/3508500 Closes #20281
This commit is contained in:
parent
4b566d8310
commit
dac98ccfa2
1 changed files with 1 additions and 1 deletions
|
|
@ -562,7 +562,7 @@ 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) {
|
||||
if(remaininglength > (MAX_MQTT_MESSAGE_SIZE - encodelen - 1)) {
|
||||
result = CURLE_TOO_LARGE;
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue