]> Dogcows Code - chaz/tint2/commitdiff
launcher: Prevent calling strlen on NULL
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Sun, 15 Aug 2010 02:24:13 +0000 (02:24 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Sun, 15 Aug 2010 02:24:13 +0000 (02:24 +0000)
src/launcher/launcher.c

index 6418a4cebc447205e30a5f22e5d4fac10fe2cbfa..c90c545a023b73290827dfbcd003bc397293f832 100644 (file)
@@ -372,7 +372,7 @@ void expand_exec(DesktopEntry *entry, const char *path)
        // %c -> Name
        // %k -> path
        if (entry->exec) {
-               char *exec2 = malloc(strlen(entry->exec) + strlen(entry->name) + strlen(entry->icon) + 100);
+               char *exec2 = malloc(strlen(entry->exec) + (entry->name ? strlen(entry->name) : 1) + (entry->icon ? strlen(entry->icon) : 1) + 100);
                char *p, *q;
                // p will never point to an escaped char
                for (p = entry->exec, q = exec2; *p; p++, q++) {
This page took 0.025793 seconds and 4 git commands to generate.