On Mon 2017.04.17 at 17:21 +0200, Rickard Gustafsson wrote:
> If using exec in cwm to launch a program outside of $PATH by giving the
> path to the program cwm will die if you happen to press up or down.
> 
> Example:
> M-?
> /opt (and press down)
> Boom crash because cwm tries to write to a null pointer.
> 
> I have solved this for my self by not letting cwm work on the queues if the
> searchstr starts with '/'.

Hi - Thank you for the report. In fact, I knew about something like this for a
while but didn't know how to reproduce it, until now. In any case, your idea
works as a quick fix, but the menu'ing code needs some help to solve it
for real.

Thanks!

> --- menu_orig.c       2017-04-17 17:14:32.165495552 +0200
> +++ menu.c    2017-04-17 17:14:02.548495202 +0200
> @@ -236,6 +236,9 @@
>               }
>               break;
>       case CTL_UP:
> +             if (mc->searchstr[0] == '/')
> +                     return(NULL);
> +
>               mi = TAILQ_LAST(resultq, menu_q);
>               if (mi == NULL)
>                       break;
> @@ -244,6 +247,9 @@
>               TAILQ_INSERT_HEAD(resultq, mi, resultentry);
>               break;
>       case CTL_DOWN:
> +             if (mc->searchstr[0] == '/')
> +                     return(NULL);
> +
>               mi = TAILQ_FIRST(resultq);
>               if (mi == NULL)
>                       break;

Reply via email to