ncurses-6.6-1.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-563): [#def1]
/usr/bin/ncurses6-config:44:1: warning[SC2034]: datarootdir appears unused. Verify use (or export if used externally).
#   42|   bindir="/usr/bin"
#   43|   includedir="/usr/include"
#   44|-> datarootdir="${prefix}/share"
#   45|   datadir="/usr/share"
#   46|   mandir="/usr/share/man"

Error: SHELLCHECK_WARNING (CWE-457): [#def2]
/usr/bin/ncurses6-config:50:13: warning[SC2154]: libdir is referenced but not assigned.
#   48|   CURSES_LIB="ncurses"
#   49|   TINFO_LIB="tinfo"
#   50|-> RPATH_LIST="${libdir}"
#   51|   
#   52|   # Ensure that RPATH_LIST contains only absolute pathnames, if it is nonempty.

Error: SHELLCHECK_WARNING (CWE-398): [#def3]
/usr/bin/ncurses6-config:79:11: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   77|   # the headers to include like this:
#   78|   #	<ncurses/curses.h>
#   79|-> if [ xyes = xno ]; then
#   80|   	includesubdir="/usr/include/${CURSES_LIB}"
#   81|   	case $includedir in

Error: SHELLCHECK_WARNING (CWE-691): [#def4]
/usr/bin/ncurses6-config:82:2: warning[SC2254]: Quote expansions in case patterns to match literally rather than as a glob.
#   80|   	includesubdir="/usr/include/${CURSES_LIB}"
#   81|   	case $includedir in
#   82|-> 	$prefix/include/ncurses)
#   83|   		includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
#   84|   		;;

Error: SHELLCHECK_WARNING (CWE-398): [#def5]
/usr/bin/ncurses6-config:91:14: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   89|   
#   90|   LIBS=""
#   91|-> if [ "tinfo" = "ncurses" ]; then
#   92|   	LIBS="-l${CURSES_LIB} $LIBS"
#   93|   else

Error: SHELLCHECK_WARNING (CWE-398): [#def6]
/usr/bin/ncurses6-config:101:10: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   99|   	CFLAGS="$CFLAGS -I${includesubdir}"
#  100|   	if [ "$includedir" != "/usr/include" ]; then
#  101|-> 		[ xyes = xno ] && CFLAGS="$CFLAGS -I${includedir}"
#  102|   	fi
#  103|   fi

Error: SHELLCHECK_WARNING (CWE-398): [#def7]
/usr/bin/ncurses6-config:318:15: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#  316|   	--includedir)
#  317|   		INCS=
#  318|-> 		if [ "xyes" = xno ]; then
#  319|   			INCS="${includesubdir}"
#  320|   		elif [ "${includedir}" != /usr/include ]; then

Error: SHELLCHECK_WARNING (CWE-563): [#def8]
/usr/bin/ncursesw6-config:44:1: warning[SC2034]: datarootdir appears unused. Verify use (or export if used externally).
#   42|   bindir="/usr/bin"
#   43|   includedir="/usr/include"
#   44|-> datarootdir="${prefix}/share"
#   45|   datadir="/usr/share"
#   46|   mandir="/usr/share/man"

Error: SHELLCHECK_WARNING (CWE-457): [#def9]
/usr/bin/ncursesw6-config:50:13: warning[SC2154]: libdir is referenced but not assigned.
#   48|   CURSES_LIB="ncursesw"
#   49|   TINFO_LIB="tinfo"
#   50|-> RPATH_LIST="${libdir}"
#   51|   
#   52|   # Ensure that RPATH_LIST contains only absolute pathnames, if it is nonempty.

Error: SHELLCHECK_WARNING (CWE-398): [#def10]
/usr/bin/ncursesw6-config:79:11: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   77|   # the headers to include like this:
#   78|   #	<ncursesw/curses.h>
#   79|-> if [ xyes = xno ]; then
#   80|   	includesubdir="/usr/include/${CURSES_LIB}"
#   81|   	case $includedir in

Error: SHELLCHECK_WARNING (CWE-691): [#def11]
/usr/bin/ncursesw6-config:82:2: warning[SC2254]: Quote expansions in case patterns to match literally rather than as a glob.
#   80|   	includesubdir="/usr/include/${CURSES_LIB}"
#   81|   	case $includedir in
#   82|-> 	$prefix/include/ncursesw)
#   83|   		includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
#   84|   		;;

Error: SHELLCHECK_WARNING (CWE-398): [#def12]
/usr/bin/ncursesw6-config:91:14: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   89|   
#   90|   LIBS=""
#   91|-> if [ "tinfo" = "ncurses" ]; then
#   92|   	LIBS="-l${CURSES_LIB} $LIBS"
#   93|   else

Error: SHELLCHECK_WARNING (CWE-398): [#def13]
/usr/bin/ncursesw6-config:101:10: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   99|   	CFLAGS="$CFLAGS -I${includesubdir}"
#  100|   	if [ "$includedir" != "/usr/include" ]; then
#  101|-> 		[ xyes = xno ] && CFLAGS="$CFLAGS -I${includedir}"
#  102|   	fi
#  103|   fi

Error: SHELLCHECK_WARNING (CWE-398): [#def14]
/usr/bin/ncursesw6-config:318:15: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#  316|   	--includedir)
#  317|   		INCS=
#  318|-> 		if [ "xyes" = xno ]; then
#  319|   			INCS="${includesubdir}"
#  320|   		elif [ "${includedir}" != /usr/include ]; then

Error: COMPILER_WARNING (CWE-569): [#def15]
ncurses-6.6/configure: scope_hint: In function 'int main()'
ncurses-6.6/configure:26731:18: warning[-Wbool-compare]: comparison of constant '0' with boolean expression is always true
#26731 | fi
#      |                  ^   
#26729|   cat "conftest.$ac_ext" >&5
#26730|   cf_cv_type_of_bool=unknown
#26731|-> fi
#26732|   rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
#26733|   fi

Error: COMPILER_WARNING (CWE-563): [#def16]
ncurses-6.6/configure: scope_hint: In function 'int main()'
ncurses-6.6/configure:27012:14: warning[-Wunused-variable]: unused variable 'p_UserData'
#27012 | 
#      |              ^         
#27010|   main (void)
#27011|   {
#27012|-> 
#27013|   	const char* p_UserData = static_cast<char*>(0)
#27014|     ;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def17]
ncurses-6.6/form/frm_def.c:234:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>.pmin’
ncurses-6.6/form/frm_def.c:178:10: branch_false: following ‘false’ branch...
ncurses-6.6/form/frm_def.c:180:10: branch_false: ...to here
ncurses-6.6/form/frm_def.c:180:10: branch_true: following ‘true’ branch (when ‘field_cnt == 0’)...
ncurses-6.6/form/frm_def.c:182:9: branch_true: ...to here
ncurses-6.6/form/frm_def.c:176:23: branch_true: following ‘true’ branch...
ncurses-6.6/form/frm_def.c:178:11: branch_true: ...to here
ncurses-6.6/form/frm_def.c:178:10: branch_false: following ‘false’ branch...
ncurses-6.6/form/frm_def.c:180:10: branch_false: ...to here
ncurses-6.6/form/frm_def.c:185:6: branch_false: following ‘false’ branch...
ncurses-6.6/form/frm_def.c:189:6: branch_true: following ‘true’ branch (when ‘pg’ is non-NULL)...
ncurses-6.6/form/frm_def.c:192:7: branch_true: ...to here
ncurses-6.6/form/frm_def.c:199:15: branch_false: following ‘false’ branch (when ‘field_cnt <= j’)...
ncurses-6.6/form/frm_def.c:225:21: branch_false: ...to here
ncurses-6.6/form/frm_def.c:230:21: branch_true: following ‘true’ branch...
ncurses-6.6/form/frm_def.c:234:26: branch_true: ...to here
ncurses-6.6/form/frm_def.c:234:16: danger: use of uninitialized value ‘*<unknown>.pmin’ here
#  232|         FIELD *fld = (FIELD *)0;
#  233|   
#  234|->       for (j = form->page[page_nr].pmin; j <= form->page[page_nr].pmax; j++)
#  235|   	{
#  236|   	  fields[j]->index = (short)j;

Error: COMPILER_WARNING (CWE-704): [#def18]
ncurses-6.6/ncurses/base/lib_mouse.c: scope_hint: In function ‘init_xterm_mouse’
ncurses-6.6/ncurses/base/lib_mouse.c:392:22: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  392 |         char *code = strstr(sp->_mouse_xtermcap, "[?");
#      |                      ^~~~~~
#  390|       sp->_mouse_xtermcap = tigetstr(UserCap(XM));
#  391|       if (VALID_STRING(sp->_mouse_xtermcap)) {
#  392|-> 	char *code = strstr(sp->_mouse_xtermcap, "[?");
#  393|   	if (code != NULL) {
#  394|   	    code += 2;

Error: COMPILER_WARNING (CWE-704): [#def19]
ncurses-6.6/ncurses/base/lib_mouse.c:392:22: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  390|       sp->_mouse_xtermcap = tigetstr(UserCap(XM));
#  391|       if (VALID_STRING(sp->_mouse_xtermcap)) {
#  392|-> 	char *code = strstr(sp->_mouse_xtermcap, "[?");
#  393|   	if (code != NULL) {
#  394|   	    code += 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
ncurses-6.6/ncurses/base/lib_set_term.c:788:12: warning[-Wanalyzer-malloc-leak]: leak of ‘sp’
ncurses-6.6/ncurses/base/lib_set_term.c:773:1: enter_function: entry to ‘_nc_setupscreen’
ncurses-6.6/ncurses/base/lib_set_term.c:780:14: call_function: calling ‘_nc_setupscreen_sp’ from ‘_nc_setupscreen’
ncurses-6.6/ncurses/base/lib_set_term.c:780:14: return_function: returning to ‘_nc_setupscreen’ from ‘_nc_setupscreen_sp’
ncurses-6.6/ncurses/base/lib_set_term.c:786:8: branch_true: following ‘true’ branch...
ncurses-6.6/ncurses/base/lib_set_term.c:787:9: branch_true: ...to here
ncurses-6.6/ncurses/base/lib_set_term.c:788:12: danger: ‘sp’ leaks here; was allocated at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#  786|       if (rc != OK)
#  787|   	_nc_set_screen(NULL);
#  788|->     return rc;
#  789|   }
#  790|   #endif

Error: GCC_ANALYZER_WARNING (CWE-457): [#def21]
ncurses-6.6/ncurses/tinfo/alloc_entry.c:205:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘offsets[i]’
ncurses-6.6/ncurses/tinfo/alloc_entry.c:139:1: enter_function: entry to ‘_nc_wrap_entry’
ncurses-6.6/ncurses/tinfo/alloc_entry.c:150:8: branch_false: following ‘false’ branch...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:155:8: branch_true: following ‘true’ branch (when ‘copy_strings != 0’)...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:156:9: branch_true: ...to here
ncurses-6.6/ncurses/tinfo/alloc_entry.c:159:26: call_function: calling ‘_nc_save_str’ from ‘_nc_wrap_entry’
ncurses-6.6/ncurses/tinfo/alloc_entry.c:159:26: return_function: returning to ‘_nc_wrap_entry’ from ‘_nc_save_str’
ncurses-6.6/ncurses/tinfo/alloc_entry.c:161:16: branch_false: following ‘false’ branch...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:160:9: branch_false: ...to here
ncurses-6.6/ncurses/tinfo/alloc_entry.c:161:16: branch_false: following ‘false’ branch...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:160:9: branch_false: ...to here
ncurses-6.6/ncurses/tinfo/alloc_entry.c:166:21: branch_false: following ‘false’ branch (when ‘i >= nuses’)...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:172:14: branch_false: ...to here
ncurses-6.6/ncurses/tinfo/alloc_entry.c:177:5: branch_false: following ‘false’ branch...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:177:5: branch_false: ...to here
ncurses-6.6/ncurses/tinfo/alloc_entry.c:189:17: branch_false: following ‘false’ branch (when ‘i >= nuses’)...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:196:5: branch_false: ...to here
ncurses-6.6/ncurses/tinfo/alloc_entry.c:196:5: branch_false: following ‘false’ branch...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:197:8: branch_false: ...to here
ncurses-6.6/ncurses/tinfo/alloc_entry.c:197:8: branch_false: following ‘false’ branch...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:200:16: branch_false: ...to here
ncurses-6.6/ncurses/tinfo/alloc_entry.c:203:5: branch_true: following ‘true’ branch...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:204:12: branch_true: ...to here
ncurses-6.6/ncurses/tinfo/alloc_entry.c:204:12: branch_true: following ‘true’ branch (when ‘i <= 2047’)...
ncurses-6.6/ncurses/tinfo/alloc_entry.c:205:17: branch_true: ...to here
ncurses-6.6/ncurses/tinfo/alloc_entry.c:205:17: danger: use of uninitialized value ‘offsets[i]’ here
#  203|       for_each_string(i, &(ep->tterm)) {
#  204|   	if (i < SIZEOF(offsets)) {
#  205|-> 	    if (offsets[i] == ABSENT_OFFSET) {
#  206|   		tp->Strings[i] = ABSENT_STRING;
#  207|   	    } else if (offsets[i] == CANCELLED_OFFSET) {

Error: COMPILER_WARNING (CWE-704): [#def22]
ncurses-6.6/ncurses/tinfo/captoinfo.c: scope_hint: In function ‘_nc_infotocap’
ncurses-6.6/ncurses/tinfo/captoinfo.c:848:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  848 |                    && (cp = strchr(str, '+'))) {
#      |                           ^
#  846|   		    || sscanf(str, "%%'%c'%%+%%%c", &ch1, &ch2) == 2)
#  847|   		   && ch2 == 'c'
#  848|-> 		   && (cp = strchr(str, '+'))) {
#  849|   	    str = cp + 2;
#  850|   	    bufptr = save_string(bufptr, "%+");

Error: COMPILER_WARNING (CWE-704): [#def23]
ncurses-6.6/ncurses/tinfo/captoinfo.c:848:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  846|   		    || sscanf(str, "%%'%c'%%+%%%c", &ch1, &ch2) == 2)
#  847|   		   && ch2 == 'c'
#  848|-> 		   && (cp = strchr(str, '+'))) {
#  849|   	    str = cp + 2;
#  850|   	    bufptr = save_string(bufptr, "%+");

Error: COMPILER_WARNING (CWE-704): [#def24]
ncurses-6.6/ncurses/tinfo/comp_parse.c: scope_hint: In function ‘check_collisions’
ncurses-6.6/ncurses/tinfo/comp_parse.c:128:29: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  128 |     for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) {
#      |                             ^
#  126|   #endif
#  127|   
#  128|->     for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) {
#  129|   	for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) {
#  130|   	    if ((pend - pstart == qend - qstart)

Error: COMPILER_WARNING (CWE-704): [#def25]
ncurses-6.6/ncurses/tinfo/comp_parse.c:128:29: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  126|   #endif
#  127|   
#  128|->     for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) {
#  129|   	for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) {
#  130|   	    if ((pend - pstart == qend - qstart)

Error: COMPILER_WARNING (CWE-704): [#def26]
ncurses-6.6/ncurses/tinfo/comp_parse.c:129:33: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  129 |         for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) {
#      |                                 ^
#  127|   
#  128|       for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) {
#  129|-> 	for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) {
#  130|   	    if ((pend - pstart == qend - qstart)
#  131|   		&& memcmp(pstart, qstart, (size_t) (pend - pstart)) == 0) {

Error: COMPILER_WARNING (CWE-704): [#def27]
ncurses-6.6/ncurses/tinfo/comp_parse.c:129:33: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  127|   
#  128|       for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) {
#  129|-> 	for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) {
#  130|   	    if ((pend - pstart == qend - qstart)
#  131|   		&& memcmp(pstart, qstart, (size_t) (pend - pstart)) == 0) {

Error: COMPILER_WARNING: [#def28]
ncurses-6.6/ncurses/tinfo/comp_parse.c: scope_hint: In function ‘_nc_read_entry_source’
ncurses-6.6/ncurses/tinfo/comp_parse.c:224:9: warning[-Wunused-but-set-variable=]: variable ‘immediate’ set but not used
#  224 |     int immediate = 0;
#      |         ^~~~~~~~~
#  222|       ENTRY thisentry;
#  223|       bool oldsuppress = _nc_suppress_warnings;
#  224|->     int immediate = 0;
#  225|   
#  226|       DEBUG(2,

Error: CPPCHECK_WARNING (CWE-682): [#def29]
ncurses-6.6/ncurses/tinfo/comp_scan.c:494: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  492|   #endif
#  493|   	tok_ptr = tok_buf;
#  494|-> 	AddCh(ch);
#  495|   
#  496|   	if (first_column) {

Error: CPPCHECK_WARNING (CWE-476): [#def30]
ncurses-6.6/ncurses/tinfo/comp_scan.c:494: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tok_ptr++
#  492|   #endif
#  493|   	tok_ptr = tok_buf;
#  494|-> 	AddCh(ch);
#  495|   
#  496|   	if (first_column) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def31]
ncurses-6.6/ncurses/tinfo/db_iterator.c:136:24: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘value’ where non-null expected
ncurses-6.6/ncurses/tinfo/db_iterator.c:178:1: enter_function: entry to ‘cache_expired’
ncurses-6.6/ncurses/tinfo/db_iterator.c:183:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
 call_function: calling ‘cache_expired’ from ‘cache_expired’
#  134|   		      (value != NULL &&
#  135|   		       cached_value != NULL &&
#  136|-> 		       strcmp(value, cached_value) == 0));
#  137|   
#  138|   	/* Set variable name to enable checks in cache_expired(). */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def32]
ncurses-6.6/ncurses/tinfo/read_entry.c:129:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
ncurses-6.6/ncurses/tinfo/read_entry.c:582:1: enter_function: entry to ‘_nc_read_file_entry’
ncurses-6.6/ncurses/tinfo/read_entry.c:588:9: branch_false: following ‘false’ branch...
ncurses-6.6/ncurses/tinfo/read_entry.c:596:23: branch_false: ...to here
ncurses-6.6/ncurses/tinfo/read_entry.c:597:12: branch_true: following ‘true’ branch (when ‘limit > 0’)...
ncurses-6.6/ncurses/tinfo/read_entry.c:598:38: branch_true: ...to here
ncurses-6.6/ncurses/tinfo/read_entry.c:603:25: call_function: calling ‘_nc_read_termtype’ from ‘_nc_read_file_entry’
#  127|       int i;
#  128|       for (i = 0; i < count; i++) {
#  129|-> 	if (IS_NEG1(buf + 2 * i))
#  130|   	    Numbers[i] = ABSENT_NUMERIC;
#  131|   	else if (IS_NEG2(buf + 2 * i))

Error: COMPILER_WARNING: [#def33]
ncurses-6.6/ncurses/tinfo/read_entry.c: scope_hint: In function ‘_nc_read_termtype’
ncurses-6.6/ncurses/tinfo/read_entry.c:496:17: warning[-Wunused-but-set-variable=]: variable ‘check’ set but not used
#  496 |             int check = (ext_bool_count + ext_num_count + ext_str_count);
#      |                 ^~~~~
#  494|   
#  495|   	if ((ptr->ext_Strings = UShort(ext_str_count)) != 0) {
#  496|-> 	    int check = (ext_bool_count + ext_num_count + ext_str_count);
#  497|   
#  498|   	    TR(TRACE_DATABASE,

Error: CPPCHECK_WARNING (CWE-476): [#def34]
ncurses-6.6/ncurses/tinfo/trim_sgr0.c:233: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: string
#  231|   {
#  232|       TR(TRACE_DATABASE, ("chop_out %d..%d from %s", i, j, _nc_visbuf(string)));
#  233|->     while (string[j] != '\0') {
#  234|   	string[i++] = string[j++];
#  235|       }

Error: CPPCHECK_WARNING (CWE-476): [#def35]
ncurses-6.6/ncurses/tinfo/trim_sgr0.c:382: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  380|   	    }
#  381|   	    TR(TRACE_DATABASE, ("...adjusted sgr0 : %s", _nc_visbuf(result)));
#  382|-> 	    if (!strcmp(result, exit_attribute_mode)) {
#  383|   		TR(TRACE_DATABASE, ("...same result, discard"));
#  384|   		free(result);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def36]
ncurses-6.6/ncurses/tinfo/write_entry.c:583:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘src’
ncurses-6.6/ncurses/tinfo/write_entry.c:736:1: enter_function: entry to ‘_nc_write_object’
ncurses-6.6/ncurses/tinfo/write_entry.c:820:9: call_function: calling ‘fake_write’ from ‘_nc_write_object’
#  581|   	if (want > have)
#  582|   	    want = have;
#  583|-> 	memcpy(dst + *offset, src, want);
#  584|   	*offset += (unsigned) want;
#  585|       } else {

Error: CPPCHECK_WARNING (CWE-401): [#def37]
ncurses-6.6/progs/infocmp.c:1398: error[memleakOnRealloc]: Common realloc mistake: 'known' nulled but not freed upon failure
# 1396|   	    if (dumped + 2 > length) {
# 1397|   		length += 100;
# 1398|-> 		known = realloc(known, length * sizeof(*known));
# 1399|   	    }
# 1400|   	    printf("\n");

Error: GCC_ANALYZER_WARNING (CWE-688): [#def38]
ncurses-6.6/progs/tabs.c:125:19: warning[-Wanalyzer-null-argument]: use of NULL ‘tab_list’ where non-null expected
ncurses-6.6/progs/tabs.c:479:1: enter_function: entry to ‘main’
ncurses-6.6/progs/tabs.c:487:11: release_memory: ‘append’ is NULL
ncurses-6.6/progs/tabs.c:637:8: branch_false: following ‘false’ branch (when ‘margin <= 0’)...
ncurses-6.6/progs/tabs.c:640:10: branch_false: ...to here
ncurses-6.6/progs/tabs.c:640:8: branch_false: following ‘false’ branch...
ncurses-6.6/progs/tabs.c:644:17: branch_false: ...to here
ncurses-6.6/progs/tabs.c:644:15: branch_false: following ‘false’ branch...
ncurses-6.6/progs/tabs.c:648:16: branch_false: ...to here
ncurses-6.6/progs/tabs.c:648:16: call_function: calling ‘legal_tab_list’ from ‘main’
ncurses-6.6/progs/tabs.c:648:16: return_function: returning to ‘main’ from ‘legal_tab_list’
ncurses-6.6/progs/tabs.c:648:15: branch_true: following ‘true’ branch...
ncurses-6.6/progs/tabs.c:651:12: branch_true: ...to here
ncurses-6.6/progs/tabs.c:651:12: branch_true: following ‘true’ branch (when ‘tab_list’ is NULL)...
ncurses-6.6/progs/tabs.c:652:24: branch_true: ...to here
ncurses-6.6/progs/tabs.c:652:24: call_function: calling ‘add_to_tab_list’ from ‘main’
ncurses-6.6/progs/tabs.c:652:24: return_function: returning to ‘main’ from ‘add_to_tab_list’
ncurses-6.6/progs/tabs.c:654:12: branch_false: following ‘false’ branch (when ‘no_op == 0’)...
ncurses-6.6/progs/tabs.c:657:17: branch_false: ...to here
ncurses-6.6/progs/tabs.c:657:16: branch_false: following ‘false’ branch...
ncurses-6.6/progs/tabs.c:666:18: branch_false: ...to here
ncurses-6.6/progs/tabs.c:671:12: branch_false: following ‘false’ branch (when ‘margin < 0’)...
ncurses-6.6/progs/tabs.c:671:12: branch_false: ...to here
ncurses-6.6/progs/tabs.c:684:16: call_function: calling ‘decode_tabs’ from ‘main’
#  123|   decode_tabs(const char *tab_list, int margin)
#  124|   {
#  125|->     int *result = typeCalloc(int, strlen(tab_list) + (unsigned) max_cols);
#  126|       int n = 0;
#  127|       int value = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
ncurses-6.6/progs/tabs.c:256:38: warning[-Wanalyzer-malloc-leak]: leak of ‘trimmed_tab_list(value)’
ncurses-6.6/progs/tabs.c:479:1: enter_function: entry to ‘main’
ncurses-6.6/progs/tabs.c:500:17: branch_true: following ‘true’ branch (when ‘n < argc’)...
ncurses-6.6/progs/tabs.c:501:28: branch_true: ...to here
ncurses-6.6/progs/tabs.c:620:16: branch_false: following ‘false’ branch...
ncurses-6.6/progs/tabs.c:627:24: branch_false: ...to here
ncurses-6.6/progs/tabs.c:627:24: call_function: calling ‘add_to_tab_list’ from ‘main’
#  254|   	int j, k, last;
#  255|   
#  256|-> 	for (j = k = last = 0; result[j] != 0; ++j) {
#  257|   	    int ch = UChar(result[j]);
#  258|   	    if (isspace(ch)) {

Error: CPPCHECK_WARNING (CWE-476): [#def40]
ncurses-6.6/progs/tabs.c:433: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: value
#  431|   skip_list(char *value)
#  432|   {
#  433|->     while (*value != '\0' &&
#  434|   	   (isdigit(UChar(*value)) ||
#  435|   	    isspace(UChar(*value)) ||

Error: GCC_ANALYZER_WARNING (CWE-476): [#def41]
ncurses-6.6/progs/tabs.c:433:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘value’
ncurses-6.6/progs/tabs.c:479:1: enter_function: entry to ‘main’
ncurses-6.6/progs/tabs.c:500:17: branch_true: following ‘true’ branch (when ‘n < argc’)...
ncurses-6.6/progs/tabs.c:501:28: branch_true: ...to here
ncurses-6.6/progs/tabs.c:574:24: branch_true: following ‘true’ branch...
ncurses-6.6/progs/tabs.c:575:38: branch_true: ...to here
ncurses-6.6/progs/tabs.c:575:38: acquire_memory: this call could return NULL
ncurses-6.6/progs/tabs.c:576:26: call_function: calling ‘skip_list’ from ‘main’
#  431|   skip_list(char *value)
#  432|   {
#  433|->     while (*value != '\0' &&
#  434|   	   (isdigit(UChar(*value)) ||
#  435|   	    isspace(UChar(*value)) ||

Error: CPPCHECK_WARNING (CWE-476): [#def42]
ncurses-6.6/progs/tabs.c:434: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: value
#  432|   {
#  433|       while (*value != '\0' &&
#  434|-> 	   (isdigit(UChar(*value)) ||
#  435|   	    isspace(UChar(*value)) ||
#  436|   	    strchr("+,", UChar(*value)) != NULL)) {

Error: CPPCHECK_WARNING (CWE-476): [#def43]
ncurses-6.6/progs/tabs.c:435: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: value
#  433|       while (*value != '\0' &&
#  434|   	   (isdigit(UChar(*value)) ||
#  435|-> 	    isspace(UChar(*value)) ||
#  436|   	    strchr("+,", UChar(*value)) != NULL)) {
#  437|   	++value;

Error: CPPCHECK_WARNING (CWE-476): [#def44]
ncurses-6.6/progs/tabs.c:436: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: value
#  434|   	   (isdigit(UChar(*value)) ||
#  435|   	    isspace(UChar(*value)) ||
#  436|-> 	    strchr("+,", UChar(*value)) != NULL)) {
#  437|   	++value;
#  438|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
ncurses-6.6/progs/tic.c:429:23: warning[-Wanalyzer-malloc-leak]: leak of ‘open_tempfile(alt_file)’
ncurses-6.6/progs/tic.c:453:1: enter_function: entry to ‘open_input’
ncurses-6.6/progs/tic.c:461:15: branch_true: following ‘true’ branch...
ncurses-6.6/progs/tic.c:465:25: branch_true: ...to here
ncurses-6.6/progs/tic.c:465:15: branch_false: following ‘false’ branch...
ncurses-6.6/progs/tic.c:466:20: branch_false: ...to here
ncurses-6.6/progs/tic.c:473:12: branch_false: following ‘false’ branch...
ncurses-6.6/progs/tic.c:478:12: branch_false: ...to here
ncurses-6.6/progs/tic.c:478:12: branch_true: following ‘true’ branch...
ncurses-6.6/progs/tic.c:479:16: branch_true: ...to here
ncurses-6.6/progs/tic.c:479:16: branch_true: following ‘true’ branch (when ‘alt_file’ is non-NULL)...
ncurses-6.6/progs/tic.c:480:29: branch_true: ...to here
ncurses-6.6/progs/tic.c:480:29: call_function: calling ‘copy_input’ from ‘open_input’
#  427|   	    if (feof(source)) {
#  428|   		break;
#  429|-> 	    } else if (ferror(source)) {
#  430|   		failed(filename);
#  431|   	    } else if (ch == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
ncurses-6.6/progs/tic.c:431:23: warning[-Wanalyzer-malloc-leak]: leak of ‘open_tempfile(alt_file)’
ncurses-6.6/progs/tic.c:453:1: enter_function: entry to ‘open_input’
ncurses-6.6/progs/tic.c:461:15: branch_true: following ‘true’ branch...
ncurses-6.6/progs/tic.c:465:25: branch_true: ...to here
ncurses-6.6/progs/tic.c:465:15: branch_false: following ‘false’ branch...
ncurses-6.6/progs/tic.c:466:20: branch_false: ...to here
ncurses-6.6/progs/tic.c:473:12: branch_false: following ‘false’ branch...
ncurses-6.6/progs/tic.c:478:12: branch_false: ...to here
ncurses-6.6/progs/tic.c:478:12: branch_true: following ‘true’ branch...
ncurses-6.6/progs/tic.c:479:16: branch_true: ...to here
ncurses-6.6/progs/tic.c:479:16: branch_true: following ‘true’ branch (when ‘alt_file’ is non-NULL)...
ncurses-6.6/progs/tic.c:480:29: branch_true: ...to here
ncurses-6.6/progs/tic.c:480:29: call_function: calling ‘copy_input’ from ‘open_input’
#  429|   	    } else if (ferror(source)) {
#  430|   		failed(filename);
#  431|-> 	    } else if (ch == 0) {
#  432|   		/* don't loop in case someone wants to convert /dev/zero */
#  433|   		fprintf(stderr, "%s: %s is not a text-file\n", _nc_progname, filename);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def47]
ncurses-6.6/progs/tic.c:1225:22: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘strdup(value)’ where non-null expected
ncurses-6.6/progs/tic.c:3198:1: enter_function: entry to ‘check_termtype’
ncurses-6.6/progs/tic.c:3236:5: call_function: calling ‘check_acs’ from ‘check_termtype’
ncurses-6.6/progs/tic.c:3236:5: return_function: returning to ‘check_termtype’ from ‘check_acs’
ncurses-6.6/progs/tic.c:3237:5: call_function: calling ‘check_colors’ from ‘check_termtype’
# 1223|   	    char *oldvalue = safe_strdup(TIPARM_1(oldcap, n));
# 1224|   	    char *newvalue = safe_strdup(TIPARM_1(newcap, n));
# 1225|-> 	    same += !strcmp(oldvalue, newvalue);
# 1226|   	    free(oldvalue);
# 1227|   	    free(newvalue);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def48]
ncurses-6.6/progs/tic.c:2353:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘always’
ncurses-6.6/progs/tic.c:3198:1: enter_function: entry to ‘check_termtype’
ncurses-6.6/progs/tic.c:3204:5: branch_true: following ‘true’ branch...
ncurses-6.6/progs/tic.c:3205:25: branch_true: ...to here
ncurses-6.6/progs/tic.c:3206:12: branch_true: following ‘true’ branch...
ncurses-6.6/progs/tic.c:3207:32: branch_true: ...to here
ncurses-6.6/progs/tic.c:3207:32: branch_false: following ‘false’ branch (when ‘j <= 413’)...
ncurses-6.6/progs/tic.c:3207:25: branch_false: ...to here
ncurses-6.6/progs/tic.c:3212:16: branch_false: following ‘false’ branch (when ‘j <= 413’)...
ncurses-6.6/progs/tic.c:3213:17: branch_false: ...to here
ncurses-6.6/progs/tic.c:3212:17: branch_false: following ‘false’ branch...
ncurses-6.6/progs/tic.c:3217:13: branch_false: ...to here
ncurses-6.6/progs/tic.c:3217:13: branch_false: following ‘false’ branch (when ‘j <= 413’)...
ncurses-6.6/progs/tic.c:3217:13: branch_false: ...to here
ncurses-6.6/progs/tic.c:3218:16: branch_true: following ‘true’ branch...
ncurses-6.6/progs/tic.c:3219:17: branch_true: ...to here
ncurses-6.6/progs/tic.c:3219:17: call_function: calling ‘check_infotocap’ from ‘check_termtype’
# 2351|   	    star = 1;
# 2352|   	} else {
# 2353|-> 	    *always = 1;
# 2354|   	}
# 2355|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
ncurses-6.6/progs/tic.c:2703:26: warning[-Wanalyzer-malloc-leak]: leak of ‘get_fkey_list(tp)’
ncurses-6.6/progs/tic.c:2752:1: enter_function: entry to ‘check_conflict’
ncurses-6.6/progs/tic.c:2756:29: call_function: calling ‘get_fkey_list’ from ‘check_conflict’
ncurses-6.6/progs/tic.c:2756:29: return_function: returning to ‘check_conflict’ from ‘get_fkey_list’
ncurses-6.6/progs/tic.c:2703:26: danger: ‘get_fkey_list(tp)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/3)
# 2701|   get_fkey_list(TERMTYPE2 *tp)
# 2702|   {
# 2703|->     NAME_VALUE *result = typeMalloc(NAME_VALUE, NUM_STRINGS(tp) + 1);
# 2704|       const struct tinfo_fkeys *all_fkeys = _nc_tinfo_fkeys;
# 2705|       int used = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
ncurses-6.6/progs/toe.c:388:18: warning[-Wanalyzer-malloc-leak]: leak of ‘copy_entryname(readdir(opendir(*<unknown>)))’
ncurses-6.6/progs/toe.c:600:1: enter_function: entry to ‘main’
ncurses-6.6/progs/toe.c:661:8: branch_false: following ‘false’ branch (when ‘report_file’ is NULL)...
ncurses-6.6/progs/toe.c:674:8: branch_false: ...to here
ncurses-6.6/progs/toe.c:674:8: branch_false: following ‘false’ branch (when ‘direct_dependencies == 0’)...
ncurses-6.6/progs/toe.c:692:8: branch_false: ...to here
ncurses-6.6/progs/toe.c:692:8: branch_false: following ‘false’ branch (when ‘invert_dependencies == 0’)...
ncurses-6.6/progs/toe.c:724:9: branch_false: ...to here
ncurses-6.6/progs/toe.c:724:8: branch_true: following ‘true’ branch...
ncurses-6.6/progs/toe.c:725:16: branch_true: ...to here
ncurses-6.6/progs/toe.c:725:16: call_function: calling ‘typelist’ from ‘main’
#  386|   copy_entryname(const DIRENT * src)
#  387|   {
#  388|->     size_t len = NAMLEN(src);
#  389|       char *result = malloc(len + 1);
#  390|       if (result == NULL)

Error: GCC_ANALYZER_WARNING (CWE-122): [#def51]
ncurses-6.6/progs/toe.c:742:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
ncurses-6.6/progs/toe.c:600:1: enter_function: entry to ‘main’
ncurses-6.6/progs/toe.c:661:8: branch_false: following ‘false’ branch (when ‘report_file’ is NULL)...
ncurses-6.6/progs/toe.c:674:8: branch_false: ...to here
ncurses-6.6/progs/toe.c:674:8: branch_false: following ‘false’ branch (when ‘direct_dependencies == 0’)...
ncurses-6.6/progs/toe.c:692:8: branch_false: ...to here
ncurses-6.6/progs/toe.c:692:8: branch_false: following ‘false’ branch (when ‘invert_dependencies == 0’)...
ncurses-6.6/progs/toe.c:724:9: branch_false: ...to here
ncurses-6.6/progs/toe.c:724:8: branch_false: following ‘false’ branch...
ncurses-6.6/progs/toe.c:726:15: branch_false: ...to here
ncurses-6.6/progs/toe.c:726:15: branch_true: following ‘true’ branch (when ‘all_dirs != 0’)...
ncurses-6.6/progs/toe.c:726:15: branch_true: ...to here
ncurses-6.6/progs/toe.c:733:24: branch_true: following ‘true’ branch (when ‘pass != 2’)...
ncurses-6.6/progs/toe.c:737:13: branch_true: ...to here
ncurses-6.6/progs/toe.c:746:16: branch_true: following ‘true’ branch (when ‘pass == 0’)...
ncurses-6.6/progs/toe.c:747:25: branch_true: ...to here
ncurses-6.6/progs/toe.c:747:25: call_function: calling ‘allocArgv’ from ‘main’
ncurses-6.6/progs/toe.c:747:25: return_function: returning to ‘main’ from ‘allocArgv’
ncurses-6.6/progs/toe.c:733:24: branch_true: following ‘true’ branch (when ‘pass != 2’)...
ncurses-6.6/progs/toe.c:737:13: branch_true: ...to here
ncurses-6.6/progs/toe.c:738:20: branch_true: following ‘true’ branch...
ncurses-6.6/progs/toe.c:739:21: branch_true: ...to here
ncurses-6.6/progs/toe.c:741:20: branch_true: following ‘true’ branch (when ‘pass != 0’)...
ncurses-6.6/progs/toe.c:742:26: branch_true: ...to here
ncurses-6.6/progs/toe.c:742:36: call_function: calling ‘strmalloc’ from ‘main’
ncurses-6.6/progs/toe.c:742:36: return_function: returning to ‘main’ from ‘strmalloc’
ncurses-6.6/progs/toe.c:738:20: branch_true: following ‘true’ branch...
ncurses-6.6/progs/toe.c:739:21: branch_true: ...to here
ncurses-6.6/progs/toe.c:739:20: branch_false: following ‘false’ branch...
ncurses-6.6/progs/toe.c:741:20: branch_true: following ‘true’ branch (when ‘pass != 0’)...
ncurses-6.6/progs/toe.c:742:26: branch_true: ...to here
ncurses-6.6/progs/toe.c:742:36: call_function: calling ‘strmalloc’ from ‘main’
ncurses-6.6/progs/toe.c:742:36: return_function: returning to ‘main’ from ‘strmalloc’
ncurses-6.6/progs/toe.c:742:21: danger: out-of-bounds write from byte 8 till byte 15 but region ends at byte 8
#  740|   		    continue;
#  741|   		if (pass) {
#  742|-> 		    eargv[count] = strmalloc(path);
#  743|   		}
#  744|   		++count;

Scan Properties

analyzer-version-clippy1.95.0
analyzer-version-cppcheck2.20.0
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-223.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namencurses-6.6-1.fc44
store-results-to/tmp/tmp81m9lzyw/ncurses-6.6-1.fc44.tar.xz
time-created2026-06-01 15:07:47
time-finished2026-06-01 15:16:42
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,cppcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmp81m9lzyw/ncurses-6.6-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp81m9lzyw/ncurses-6.6-1.fc44.src.rpm'
tool-versioncsmock-3.8.5.20260529.133039.g6f3b5c6-1.el9