From 9c8c85d98138af025371616e75b47d44fc63d1e5 Mon Sep 17 00:00:00 2001 From: mbm Date: Wed, 29 Oct 2008 13:46:28 +0000 Subject: [PATCH] fix a null pointer deref in vi's search git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13073 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/busybox/patches/480-vi_search.patch | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 package/busybox/patches/480-vi_search.patch diff --git a/package/busybox/patches/480-vi_search.patch b/package/busybox/patches/480-vi_search.patch new file mode 100644 index 000000000..d9fa821e4 --- /dev/null +++ b/package/busybox/patches/480-vi_search.patch @@ -0,0 +1,35 @@ +--- a/editors/vi.c ++++ b/editors/vi.c +@@ -3313,7 +3313,7 @@ + buf[1] = '\0'; + q = get_input_line(buf); // get input line- use "status line" + if (q[0] && !q[1]) { +- if (last_search_pattern[0]) ++ if (last_search_pattern) + last_search_pattern[0] = c; + goto dc3; // if no pat re-use old pat + } +@@ -3329,6 +3329,10 @@ + if (cmdcnt-- > 1) { + do_cmd(c); + } // repeat cnt ++ if (last_search_pattern == 0) { ++ msg = "No previous regular expression"; ++ goto dc2; ++ } + dir = BACK; // assume BACKWARD search + p = dot - 1; + if (last_search_pattern[0] == '?') { +@@ -3348,10 +3352,8 @@ + msg = "No previous regular expression"; + goto dc2; + } +- if (last_search_pattern[0] == '/') { +- dir = FORWARD; // assume FORWARD search +- p = dot + 1; +- } ++ dir = FORWARD; // assume FORWARD search ++ p = dot + 1; + if (last_search_pattern[0] == '?') { + dir = BACK; + p = dot - 1; -- 2.20.1