From f7f79bb1e74926809421e6795dbc463cf6720c57 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 19 Mar 2017 12:50:16 +0100 Subject: [PATCH] be more tolerant for MQTT topic but deny wildcard characters --- src/ebusd/mqtthandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ebusd/mqtthandler.cpp b/src/ebusd/mqtthandler.cpp index 82ff3878..782d5fa0 100644 --- a/src/ebusd/mqtthandler.cpp +++ b/src/ebusd/mqtthandler.cpp @@ -105,7 +105,7 @@ static error_t mqtt_parse_opt(int key, char *arg, struct argp_state *state) { break; case 5: // --mqtttopic=ebusd - if (arg == NULL || arg[0] == 0 || arg[0] == '/' || arg[strlen(arg)-1] == '/') { + if (arg == NULL || arg[0] == 0 || strchr(arg, '#') || strchr(arg, '+') || arg[strlen(arg)-1] == '/') { argp_error(state, "invalid mqtttopic"); return EINVAL; }