Several potential bugs of NULL Pointer Dereference

Bug #1941813 reported by yuxuan He
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ncurses (Ubuntu)
New
Undecided
Unassigned

Bug Description

Ubuntu version: 18.04
ncurses version:6.1

Hello,I found some potential bugs in package ncurses-6.1 .Would you help me check whether the bugs mentioned below are true? Thank you very much for your patience.

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/tinfo/lib_data.c , function _nc_screen_of line 287 :
    Select the false branch at this point (win!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/tinfo/lib_data.c , function _nc_screen_of line 290 :
    null assigned to sp reaches here

step 3 :
  In file ncurses-6.1/ncurses/tinfo/lib_data.c , function _nc_screen_of line 290 :
    Return sp to caller, which can be null

step 4 :
  In file ncurses-6.1/ncurses/base/resizeterm.c , function adjust_window line 218 :
    Function _nc_screen_of executes and returns

step 5 :
  In file ncurses-6.1/ncurses/base/resizeterm.c , function adjust_window line 218 :
    Load value from _nc_screen_of(win)->_topstolen

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook line 42 :
    Select the false branch at this point (SP!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook line 40 :
    Return null to caller

step 3 :
  In file ncurses-6.1/panel/p_new.c , function root_panel line 56 :
    Function _nc_panelhook executes and stores the return value to ph (ph can be null)

step 4 :
  In file ncurses-6.1/panel/p_new.c , function root_panel line 62 :
    Load value from ph->stdscr_pseudo_panel (_nc_stdscr_pseudo_panel is defined in panel.priv.h)

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook line 42 :
    Select the false branch at this point (SP!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook line 40 :
    Return null to caller

step 3 :
  In file ncurses-6.1/panel/p_move.c , function move_panel line 51 :
    Function _nc_panelhook_sp executes and stores the return value to ph (ph can be null)
  in file panel.priv.h(#define GetHook(pan) SCREEN* sp = _nc_screen_of(pan->win); )

step 4 :
  In file ncurses-6.1/panel/p_move.c , function move_panel line 52 :
    Load value from ph->bottom_panel
  in file panel.priv.h(#define IS_LINKED(p) (((p)->above || (p)->below ||((p)==_nc_bottom_panel)) ? TRUE : FALSE))

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/tinfo/lib_data.c , function _nc_screen_of line 287 :
    Select the false branch at this point (win!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/tinfo/lib_data.c , function _nc_screen_of line 290 :
    null assigned to sp reaches here

step 3 :
  In file ncurses-6.1/ncurses/tinfo/lib_data.c , function _nc_screen_of line 290 :
    Return sp to caller, which can be null

step 4 :
  In file ncurses-6.1/menu/m_sub.c , function set_menu_sub line 68 :
    Function _nc_screen_of executes and stores the return value to sp (sp can be null)

step 5 :
  In file ncurses-6.1/menu/m_sub.c , function set_menu_sub line 70 :
    Load value from sp->_stdscr

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 42 :
    Select the false branch at this point (SP!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 40 :
    Return null to caller

step 3 :
  In file ncurses-6.1/panel/p_hide.c , function hide_panel line 50 :
    Function _nc_panelhook_sp executes and stores the return value to ph (ph can be null)
  in file panel.priv.h(#define GetHook(pan) SCREEN* sp = _nc_screen_of(pan->win); )

step 4 :
  In file ncurses-6.1/panel/p_hide.c , function hide_panel line 55 :
    Load value from ph->bottom_panel and assign to pan
  HIDE_PANEL is defined in file panel.priv.h

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 42 :
    Select the false branch at this point (SP!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 40 :
    Return null to caller

step 3 :
  In file ncurses-6.1/panel/p_new.c , function new_panel line 96 :
    Function _nc_panelhook_sp executes and stores the return value to ph (ph can be null)
  GetWindowHook is defined in panel.priv.h

step 4 :
  In file ncurses-6.1/panel/p_new.c , function new_panel line 103 :
    Load value from ph->stdscr_pseudo_panel

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 42 :
    Select the false branch at this point (SP!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 40 :
    Return null to caller

step 3 :
  In file ncurses-6.1/panel/p_move.c , function move_panel line 51 :
    Function _nc_panelhook_sp executes and stores the return value to ph (ph can be null)
  GetHook is defined panel.priv.h

step 4 :
  In file ncurses-6.1/panel/p_move.c , function move_panel line 55 :
    Load value from ph->bottom_panel and assign to pan

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 42 :
    Select the false branch at this point (SP!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 40 :
    Return null to caller

step 3 :
  In file ncurses-6.1/panel/p_delete.c , function del_panel line 52 :
    Function _nc_panelhook_sp executes and stores the return value to ph (ph can be null)
  GetHook is defined panel.priv.h

step 4 :
  In file ncurses-6.1/panel/p_delete.c , function del_panel line 53 :
    Load value from ph->bottom_panel

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/tinfo/lib_data.c , function _nc_screen_of line 287 :
    Select the false branch at this point (win!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/tinfo/lib_data.c , function _nc_screen_of line 290 :
    null assigned to sp reaches here

step 3 :
  In file ncurses-6.1/ncurses/tinfo/lib_data.c , function _nc_screen_of line 290 :
    Return sp to caller, which can be null

step 4 :
  In file ncurses-6.1/menu/m_win.c , function set_menu_win line 68 :
    Function _nc_screen_of executes and stores the return value to sp (sp can be null)

step 5 :
  In file ncurses-6.1/menu/m_win.c , function set_menu_win line 70 :
    Load value from sp->_stdscr

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 42 :
    Select the false branch at this point (SP!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 40 :
    Return null to caller

step 3 :
  In file ncurses-6.1/panel/p_show.c , function show_panel line 50 :
    Function _nc_panelhook_sp executes and stores the return value to ph (ph can be null)
  GetHook is defined panel.priv.h

step 4 :
  In file ncurses-6.1/panel/p_show.c , function show_panel line 52 :
    Load value from ph->bottom_panel
  Is_Top is defined panel.priv.h

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 42 :
    Select the false branch at this point (SP!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 40 :
    Return null to caller

step 3 :
  In file ncurses-6.1/panel/p_hide.c , function hide_panel line 50 :
    Function _nc_panelhook_sp executes and stores the return value to ph (ph can be null)
  GetHook is defined panel.priv.h

step 4 :
  In file ncurses-6.1/panel/p_hide.c , function hide_panel line 55 :
    Load value from ph->bottom_panel
  dBug is defined panel.priv.h

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 42 :
    Select the false branch at this point (SP!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 40 :
    Return null to caller

step 3 :
  In file ncurses-6.1/panel/p_show.c , function show_panel line 50 :
    Function _nc_panelhook_sp executes and stores the return value to ph (ph can be null)
  GetHook is defined panel.priv.h

step 4 :
  In file ncurses-6.1/panel/p_show.c , function show_panel line 52 :
    Load value from ph->top_panel
  Is_Top is defined in panel.priv.h

============================================================================================================

step 1 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 42 :
    Select the false branch at this point (SP!=null is false)

step 2 :
  In file ncurses-6.1/ncurses/base/nc_panel.c , function _nc_panelhook_sp line 40 :
    Return null to caller

step 3 :
  In file ncurses-6.1/panel/p_delete.c , function del_panel line 52 :
    Function _nc_panelhook_sp executes and stores the return value to ph (ph can be null)
  GetHook is defined panel.priv.h

step 4 :
  In file ncurses-6.1/panel/p_delete.c , function del_panel line 53 :
    Load value from ph->bottom_panel and assign to pan
  HIDE_PANEL is defined in panel.priv.h

Revision history for this message
Thomas Dickey (dickey-his) wrote :

There's no test-program which demonstrates the problem,
so there is no possibility to analyze these comments.

By the way, Ubuntu provides by itself no solutions or improvements of any type for ncurses.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.