From 766bcb82ba6f01cf3216a2e1ad65d0669c887945 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 13 Feb 2013 15:12:30 -0800 Subject: Check for NULL descriptor in the input to parse_extension_descriptor. Signed-off-by: Lei Zhang Signed-off-by: Linus Walleij --- src/libmtp.c | 4 ++++ 1 file changed, 4 insertions(+) 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 */ -- cgit v1.2.1