Commit 5ae2c997 authored by rswindell's avatar rswindell
Browse files

Fix the crash I just mentioned in the previous commit - don't deref past the

length of option[].
parent bb490e59
......@@ -1715,7 +1715,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
case CTRL_G:
if(/*!(api->mode&UIFC_NOCTRL)*/1) { // No no, *this* control key is fine!
if (gotkey == CTRL_G || api->input(WIN_MID|WIN_SAV, 0, 0, "Find", search, sizeof(search), K_EDIT) > 0) {
for (j = (*cur) + 1; j != *cur; j++, j = (option[j] == NULL || !option[j][0]) ? 0 : j) { /* a = search count */
for (j = (*cur) + 1; j != *cur; j++, j = (j >= opts) ? 0 : j) {
if (strcasestr(option[j], search) != NULL) {
// Copy/pasted from search above.
if(y+(j-(*cur))+2>height+top) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment