From f7682a18977ca5144561eea59f85cef08bfa27e3 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 10 Aug 2021 20:48:21 +0100 Subject: [PATCH] Bug #575314 --- lib/property_mosq.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/property_mosq.c b/lib/property_mosq.c index 0cfc9f9c..ada66204 100644 --- a/lib/property_mosq.c +++ b/lib/property_mosq.c @@ -959,14 +959,16 @@ int mosquitto_property_check_all(int command, const mosquitto_property *properti if(rc) return rc; /* Check for duplicates */ - tail = p->next; - while(tail){ - if(p->identifier == tail->identifier - && p->identifier != MQTT_PROP_USER_PROPERTY){ + if(p->identifier != MQTT_PROP_USER_PROPERTY){ + tail = p->next; + while(tail){ + if(p->identifier == tail->identifier + && p->identifier != MQTT_PROP_USER_PROPERTY){ - return MOSQ_ERR_DUPLICATE_PROPERTY; + return MOSQ_ERR_DUPLICATE_PROPERTY; + } + tail = tail->next; } - tail = tail->next; } p = p->next; -- 2.30.2