Fix oss-fuzz #55950

Reproduces in the fuzz target, but testing hasn't reproduced in real
code.
pull/2756/head
Roger A. Light 3 years ago
parent 11cb25ee00
commit 769c94a103

@ -64,7 +64,7 @@ BROKER_EXPORT int mosquitto_validate_utf8(const char *str, int len)
} }
/* Reconstruct full code point */ /* Reconstruct full code point */
if(i == len-codelen+1){ if(i >= len-codelen+1){
/* Not enough data */ /* Not enough data */
return MOSQ_ERR_MALFORMED_UTF8; return MOSQ_ERR_MALFORMED_UTF8;
} }

Loading…
Cancel
Save