diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-05-29 23:23:02 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-05-29 23:23:02 +0000 |
commit | b03d52e6d93c1133aeaed71379ed9a64ada97790 (patch) | |
tree | 56b0b4520fa7fbf3eab2065d5deed52d0cf7620c /riscos | |
parent | cda586e6dc48de2ad8cd2dffd3760299408d3274 (diff) | |
download | netsurf-b03d52e6d93c1133aeaed71379ed9a64ada97790.tar.gz netsurf-b03d52e6d93c1133aeaed71379ed9a64ada97790.tar.bz2 |
Ensure we don't read beyond the end of the array of available matches. Set any remaining saved pointers to NULL.
svn path=/trunk/netsurf/; revision=7641
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/url_complete.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/riscos/url_complete.c b/riscos/url_complete.c index 81600f262..b242afb3f 100644 --- a/riscos/url_complete.c +++ b/riscos/url_complete.c @@ -146,10 +146,16 @@ bool ro_gui_url_complete_keypress(struct gui_window *g, uint32_t key) lines = MAXIMUM_VISIBLE_LINES; if (lines > url_complete_matches_available) lines = url_complete_matches_available; - if (url_complete_matches) - for (i = 0; i < MAXIMUM_VISIBLE_LINES; i++) - url_complete_redraw[i] = + if (url_complete_matches) { + for (i = 0; i < MAXIMUM_VISIBLE_LINES; i++) { + if (i < lines) { + url_complete_redraw[i] = url_complete_matches[i]; + } else { + url_complete_redraw[i] = NULL; + } + } + } /* our selection gets wiped */ error = xwimp_force_redraw(dialog_url_complete, |