From 49a8642986a5fb1a9d1d37ef9065dc7e6fc9d545 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 1 Nov 2018 11:59:59 +0000 Subject: [PATCH] Disallow properties that are invalid for a command. --- client/client_props.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/client_props.c b/client/client_props.c index 908fbb0f..de9db8e3 100644 --- a/client/client_props.c +++ b/client/client_props.c @@ -85,6 +85,11 @@ int cfg_parse_property(struct mosq_config *cfg, int argc, char *argv[], int *idx return MOSQ_ERR_INVAL; } + if(mosquitto_property_command_check(cmd, identifier)){ + fprintf(stderr, "Error: %s property not allow for %s in --property argument.\n\n", propname, cmdname); + return MOSQ_ERR_INVAL; + } + if(identifier == MQTT_PROP_USER_PROPERTY){ if((*idx)+3 > argc-1){ /* Not enough args */