From 15c5dafb5bd971e2e49bf17b437d1c3151fbcf5c Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Fri, 22 Aug 2025 11:09:39 +0100 Subject: [PATCH] Fix oss-fuzz flaky issue Caused by password file with many duplicate usernames, unlikely to occur in practice --- apps/mosquitto_passwd/mosquitto_passwd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/mosquitto_passwd/mosquitto_passwd.c b/apps/mosquitto_passwd/mosquitto_passwd.c index 463419ae..32247213 100644 --- a/apps/mosquitto_passwd/mosquitto_passwd.c +++ b/apps/mosquitto_passwd/mosquitto_passwd.c @@ -285,7 +285,7 @@ static int update_pwuser_cb(FILE *fptr, FILE *ftmp, const char *username, const UNUSED(fptr); UNUSED(password); - if(strcmp(username, helper->username)){ + if(helper->found || strcmp(username, helper->username)){ /* If this isn't the matching user, then writing out the exiting line */ fprintf(ftmp, "%s", line); }else{