launcher: Prevent calling strlen on NULL
git-svn-id: http://tint2.googlecode.com/svn/trunk@540 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
d16dcae93e
commit
c1bdb560b2
1 changed files with 1 additions and 1 deletions
|
@ -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++) {
|
||||
|
|
Loading…
Reference in a new issue