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 '/'.
--- 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