[vlc-commits] ncurses: fix buffer overflow when typing in the edit box

Pierre Ynard git at videolan.org
Fri Jan 28 01:47:43 CET 2011


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Fri Jan 28 01:47:01 2011 +0100| [13eba40502e7cd80da504f57e42b3a1dc3018c8c] | committer: Pierre Ynard

ncurses: fix buffer overflow when typing in the edit box

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=13eba40502e7cd80da504f57e42b3a1dc3018c8c
---

 modules/gui/ncurses.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 8b01a72..2645eac 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -1570,8 +1570,8 @@ static void HandleEditBoxKey(intf_thread_t *p_intf, int key, int box)
         break;
 
     default:
-        if (len + 1 < search ? sizeof p_sys->psz_search_chain
-                             : sizeof p_sys->psz_open_chain)
+        if (len + 1 < (search ? sizeof p_sys->psz_search_chain
+                              : sizeof p_sys->psz_open_chain))
         {
             str[len + 0] = (char) key;
             str[len + 1] = '\0';



More information about the vlc-commits mailing list