ncurses: workaround a race condition spotted by akem. darkwired pwnage
authorRafaël Carré <funman@videolan.org>
Thu, 1 Nov 2007 03:47:33 +0000 (03:47 +0000)
committerRafaël Carré <funman@videolan.org>
Thu, 1 Nov 2007 03:47:33 +0000 (03:47 +0000)
modules/gui/ncurses.c

index 3049719..f20e118 100644 (file)
@@ -579,6 +579,11 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
 
             case KEY_ENTER:
             case 0x0d:
+                if( !p_sys->pp_plist || !p_sys->pp_plist[p_sys->i_box_plidx] )
+                {
+                    b_ret = VLC_FALSE;
+                    break;
+                }
                 if( p_sys->pp_plist[p_sys->i_box_plidx]->p_item->i_children
                         == -1 )
                 {