summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@google.com>2013-02-13 15:12:30 -0800
committerLinus Walleij <triad@df.lth.se>2013-03-12 07:30:19 +0100
commit766bcb82ba6f01cf3216a2e1ad65d0669c887945 (patch)
tree5965948f25ef47513a9dd11d89932a5614b73ede
parentcaa1bbc7d817d70cb3ab45a457b430e3e288fd8f (diff)
downloadlibmtp-766bcb82ba6f01cf3216a2e1ad65d0669c887945.tar.gz
Check for NULL descriptor in the input to parse_extension_descriptor.
Signed-off-by: Lei Zhang <thestig@google.com> Signed-off-by: Linus Walleij <triad@df.lth.se>
-rw-r--r--src/libmtp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libmtp.c b/src/libmtp.c
index 96c36ef..469c105 100644
--- a/src/libmtp.c
+++ b/src/libmtp.c
@@ -1737,6 +1737,10 @@ static void parse_extension_descriptor(LIBMTP_mtpdevice_t *mtpdevice,
int start = 0;
int end = 0;
+ /* NULL on Canon A70 */
+ if (!desc)
+ return;
+
/* descriptors are divided by semicolons */
while (end < strlen(desc)) {
/* Skip past initial whitespace */