summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client.c b/src/client.c
index c6a7ce8..b30fb06 100644
--- a/src/client.c
+++ b/src/client.c
@@ -476,6 +476,11 @@ static int client_command(struct mux_client *client, struct usbmuxd_header *hdr)
} else {
char *message = NULL;
plist_t node = plist_dict_get_item(dict, "MessageType");
+ if (!node || plist_get_node_type(node) != PLIST_STRING) {
+ usbmuxd_log(LL_ERROR, "Could not read valid MessageType node from plist!");
+ plist_free(dict);
+ return -1;
+ }
plist_get_string_val(node, &message);
if (!message) {
usbmuxd_log(LL_ERROR, "Could not extract MessageType from plist!");