wgtpkg-install: Fix SEGV when no icon in config file 95/15095/1 5.99.2 flounder/5.99.2 flounder_5.99.2
authorJosé Bollo <jose.bollo@iot.bzh>
Sat, 7 Jul 2018 16:13:39 +0000 (18:13 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Sat, 7 Jul 2018 16:13:39 +0000 (18:13 +0200)
Bug-AGL: SPEC-1573

Change-Id: I891c4edc3a7ded7848fe11cbc3ce3fe429650bf8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/wgtpkg-install.c

index 9642c93..505b915 100644 (file)
@@ -458,7 +458,7 @@ static int install_security(const struct wgt_desc *desc)
        len--;
        *head++ = '/';
        icon = desc->icons ? desc->icons->src : NULL;
-       lic = (unsigned)strlen(icon);
+       lic = (unsigned)(icon ? strlen(icon) : 0);
        n = file_count();
        i = 0;
        while(i < n) {