summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-05-27 12:54:48 +0200
committerGravatar Martin Szulecki2014-05-27 12:54:48 +0200
commitaede4d06c49a8446e8011ab569c765a4f4ba32e7 (patch)
tree4cd1f988c3043893d5617581b18e0bf8eacc0020 /src
parent002e964e37ee45da88375b2938a8b302904a3c95 (diff)
downloadusbmuxd-aede4d06c49a8446e8011ab569c765a4f4ba32e7.tar.gz
usbmuxd-aede4d06c49a8446e8011ab569c765a4f4ba32e7.tar.bz2
client: Fix crash that occured when receiving client command from old client
Diffstat (limited to 'src')
-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!");