mqtt: Check for a valid payload protocol

Make the "Payload protocol" mandatory when configuring message decoding.

Change-Id: Ia3cd8cb1b789b80439f55bdd87e7f1bd806013e0
Ping-Bug: 15738
Reviewed-on: https://code.wireshark.org/review/33021
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2019-04-30 12:25:58 +02:00
parent 4addfb6b16
commit d8d1d6409e
1 changed files with 6 additions and 0 deletions

View File

@ -617,6 +617,12 @@ static gboolean mqtt_message_decode_update_cb(void *record, char **error)
return FALSE;
}
if (u->payload_proto_name == NULL || strlen(u->payload_proto_name) == 0)
{
*error = g_strdup("Missing payload protocol");
return FALSE;
}
if (u->match_criteria == MATCH_CRITERIA_REGEX)
{
u->topic_regex = g_regex_new(u->topic_pattern, (GRegexCompileFlags) G_REGEX_OPTIMIZE, (GRegexMatchFlags) 0, NULL);