mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
No cookie for okan.
fix use-after-free that broke exec's path getting stuff. ``paths'' isn't used anymore, but pointers to within that array are still used in the next loop. delay freeing it until after then.
This commit is contained in:
parent
9702d4cfd7
commit
eb77aabea1
2
kbfunc.c
2
kbfunc.c
@ -307,7 +307,6 @@ kbfunc_exec(struct client_ctx *scratch, void *arg)
|
||||
ap++;
|
||||
}
|
||||
*ap = NULL;
|
||||
xfree(path);
|
||||
for (i = 0; i < NPATHS && paths[i] != NULL; i++) {
|
||||
if ((dirp = opendir(paths[i])) == NULL)
|
||||
continue;
|
||||
@ -351,6 +350,7 @@ kbfunc_exec(struct client_ctx *scratch, void *arg)
|
||||
}
|
||||
(void) closedir(dirp);
|
||||
}
|
||||
xfree(path);
|
||||
|
||||
if ((mi = search_start(&menuq,
|
||||
search_match_exec, NULL, label, 1)) != NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user