From 769c94a10373db28ff0d63f25e6d382f5db3ec3c Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Mon, 13 Feb 2023 22:01:11 +0000 Subject: [PATCH] Fix oss-fuzz #55950 Reproduces in the fuzz target, but testing hasn't reproduced in real code. --- lib/utf8_mosq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utf8_mosq.c b/lib/utf8_mosq.c index c10c87ea..35db8766 100644 --- a/lib/utf8_mosq.c +++ b/lib/utf8_mosq.c @@ -64,7 +64,7 @@ BROKER_EXPORT int mosquitto_validate_utf8(const char *str, int len) } /* Reconstruct full code point */ - if(i == len-codelen+1){ + if(i >= len-codelen+1){ /* Not enough data */ return MOSQ_ERR_MALFORMED_UTF8; }