gawk-5.3.2-1.fc43

List of Findings

Error: SHELLCHECK_WARNING (CWE-758): [#def1]
/etc/profile.d/gawk.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> gawkpath_default () {
#    2|   	unset AWKPATH
#    3|   	export AWKPATH=`gawk 'BEGIN {print ENVIRON["AWKPATH"]}'`

Error: SHELLCHECK_WARNING (CWE-571): [#def2]
/etc/profile.d/gawk.sh:3:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#    1|   gawkpath_default () {
#    2|   	unset AWKPATH
#    3|-> 	export AWKPATH=`gawk 'BEGIN {print ENVIRON["AWKPATH"]}'`
#    4|   }
#    5|   

Error: SHELLCHECK_WARNING (CWE-571): [#def3]
/etc/profile.d/gawk.sh:18:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   16|   gawklibpath_default () {
#   17|   	unset AWKLIBPATH
#   18|-> 	export AWKLIBPATH=`gawk 'BEGIN {print ENVIRON["AWKLIBPATH"]}'`
#   19|   }
#   20|   

Error: SHELLCHECK_WARNING (CWE-480): [#def4]
/usr/bin/gawkbug:53:9: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#   51|   VERSTR="GNU gawkbug, version ${VERSION}"
#   52|   
#   53|-> do_help= do_version=
#   54|   
#   55|   while [ $# -gt 0 ]

Error: SHELLCHECK_WARNING (CWE-480): [#def5]
/usr/bin/gawkbug:102:6: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#  100|   case "$N" in
#  101|   *c)	n=-n c= ;;
#  102|-> *)	n= c='\c' ;;
#  103|   esac
#  104|   

Error: SHELLCHECK_WARNING (CWE-456): [#def6]
/usr/bin/gawkbug:146:3: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#  144|   	elif [ -x /usr/bin/vi ]
#  145|   	then
#  146|-> 		DEFEDITOR=vi
#  147|   	else
#  148|   		echo "$0: No default editor found: attempting to use vi" >&2

Error: SHELLCHECK_WARNING (CWE-456): [#def7]
/usr/bin/gawkbug:149:3: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#  147|   	else
#  148|   		echo "$0: No default editor found: attempting to use vi" >&2
#  149|-> 		DEFEDITOR=vi
#  150|   	fi
#  151|   fi

Error: SHELLCHECK_WARNING (CWE-398): [#def8]
/usr/bin/gawkbug:158:40: warning[SC2172]: Trapping signals by number is not well defined. Prefer signal names.
#  156|   : ${USER=${LOGNAME-`whoami`}}
#  157|   
#  158|-> trap 'rm -rf "$TEMPDIR"; exit 1' 1 2 3 13 15
#  159|   trap 'rm -rf "$TEMPDIR"' 0
#  160|   

Error: CPPCHECK_WARNING (CWE-823): [#def9]
gawk-5.3.2/array.c:1436: error[arrayIndexOutOfBounds]: Array 'sort_funcs[11]' accessed at index 11, which is out of bounds.
# 1434|   
# 1435|   	if (qi < j) {
# 1436|-> 		cmp_func = sort_funcs[qi].comp_func;
# 1437|   		assoc_kind = sort_funcs[qi].kind;
# 1438|   

Error: CPPCHECK_WARNING (CWE-823): [#def10]
gawk-5.3.2/array.c:1437: error[arrayIndexOutOfBounds]: Array 'sort_funcs[11]' accessed at index 11, which is out of bounds.
# 1435|   	if (qi < j) {
# 1436|   		cmp_func = sort_funcs[qi].comp_func;
# 1437|-> 		assoc_kind = sort_funcs[qi].kind;
# 1438|   
# 1439|   		if (symbol->array_funcs != & cint_array_func)

Error: CPPCHECK_WARNING (CWE-457): [#def11]
gawk-5.3.2/awkgram.y:3394: warning[uninitvar]: Uninitialized variable: tmp_state
# 3392|   					0 : work_ring_idx + 1;
# 3393|   			}
# 3394|-> 			cur_mbstate = tmp_state;
# 3395|   
# 3396|   			/* Put a mark on the position on which we write next character.  */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def12]
gawk-5.3.2/awkgram.y:6106:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
gawk-5.3.2/awkgram.y:6077:1: enter_function: entry to ‘mk_getline’
gawk-5.3.2/awkgram.y:6101:12: branch_true: following ‘true’ branch (when ‘var’ is non-NULL)...
gawk-5.3.2/awkgram.y:6102:38: branch_true: ...to here
gawk-5.3.2/awkgram.y:6102:22: call_function: inlined call to ‘make_assignable’ from ‘mk_getline’
gawk-5.3.2/awkgram.y:6106:21: danger: dereference of NULL ‘<unknown>’
# 6104|   
# 6105|   		/* check if we need after_assign bytecode */
# 6106|-> 		if (tp->opcode == Op_push_lhs
# 6107|   				&& tp->memory->type == Node_var
# 6108|   				&& tp->memory->var_assign

Error: CPPCHECK_WARNING (CWE-476): [#def13]
gawk-5.3.2/awkgram.y:6402: error[ctunullpointer]: Null pointer dereference: l
# 6400|   		cant_happen("unexpected value %s for opcode", opcode2str(l->opcode));
# 6401|   #endif
# 6402|-> 	l->lasti->nexti = x;
# 6403|   	l->lasti = x;
# 6404|   	return l;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def14]
gawk-5.3.2/builtin.c:3279:16: warning[-Wanalyzer-null-argument]: use of NULL ‘res’ where non-null expected
#argument 1 of ‘__builtin_strlen’ must be non-null
# 3277|   	if (deref)
# 3278|   		DEREF(arg);
# 3279|-> 	return make_string(res, strlen(res));
# 3280|   }
# 3281|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def15]
gawk-5.3.2/cint_array.c:1260:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
gawk-5.3.2/cint_array.c:1257:1: enter_function: entry to ‘argv_store’
gawk-5.3.2/cint_array.c:1259:22: call_function: calling ‘cint_exists’ from ‘argv_store’
gawk-5.3.2/cint_array.c:1259:22: return_function: returning to ‘argv_store’ from ‘cint_exists’
gawk-5.3.2/cint_array.c:1260:15: danger: dereference of NULL ‘cint_exists(symbol,  subs)’
# 1258|   {
# 1259|   	NODE **val = cint_exists(symbol, subs);
# 1260|-> 	NODE *newval = *val;
# 1261|   	char *cp;
# 1262|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def16]
gawk-5.3.2/command.c:1406:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
gawk-5.3.2/command.c:1364:6: branch_true: following ‘true’ branch...
gawk-5.3.2/command.c:1370:28: branch_true: ...to here
gawk-5.3.2/command.c:1393:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
gawk-5.3.2/command.c:1395:7: branch_false: ...to here
gawk-5.3.2/command.c:1404:12: branch_false: following ‘false’ branch...
gawk-5.3.2/command.c:1406:9: branch_false: ...to here
gawk-5.3.2/command.c:1406:9: danger: use of uninitialized value ‘yyss’ here
# 1404|           if (! yyptr)
# 1405|             YYNOMEM;
# 1406|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1407|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1408|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-457): [#def17]
gawk-5.3.2/command.c:1533:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
gawk-5.3.2/command.c:1364:6: branch_false: following ‘false’ branch...
gawk-5.3.2/command.c:1428:6: branch_false: ...to here
gawk-5.3.2/command.c:1428:6: branch_false: following ‘false’ branch (when ‘yystate != 2’)...
gawk-5.3.2/command.c:1431:3: branch_false: ...to here
gawk-5.3.2/command.c:1443:6: branch_true: following ‘true’ branch (when ‘yyn == -151’)...
gawk-5.3.2/command.c:1444:5: branch_true: ...to here
gawk-5.3.2/command.c:1513:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
gawk-5.3.2/command.c:1515:3: branch_false: ...to here
gawk-5.3.2/command.c:1533:3: danger: use of uninitialized value ‘*<unknown>’ here
# 1531|        unconditionally makes the parser a bit smaller, and it avoids a
# 1532|        GCC warning that YYVAL may be used uninitialized.  */
# 1533|->   yyval = yyvsp[1-yylen];
# 1534|   
# 1535|   

Error: CPPCHECK_WARNING (CWE-476): [#def18]
gawk-5.3.2/command.y:792: warning[nullPointer]: Possible null pointer dereference: stmt_list
#  790|   
#  791|   	len = strlen(stmt) + 1;	/* 1 for newline */
#  792|-> 	s = stmt_list->a_string;
#  793|   	slen = strlen(s);
#  794|   	ssize = stmt_list->a_count;

Error: CPPCHECK_WARNING (CWE-476): [#def19]
gawk-5.3.2/command.y:794: warning[nullPointer]: Possible null pointer dereference: stmt_list
#  792|   	s = stmt_list->a_string;
#  793|   	slen = strlen(s);
#  794|-> 	ssize = stmt_list->a_count;
#  795|   	if (len > ssize - slen) {
#  796|   		ssize = slen + len + EVALSIZE;

Error: CPPCHECK_WARNING (CWE-457): [#def20]
gawk-5.3.2/debug.c:1134: error[legacyUninitvar]: Uninitialized variable: pager_quit_tag_stack
# 1132|   	list = assoc_list((NODE *) arr, "@ind_str_asc", SORTED_IN);
# 1133|   
# 1134|-> 	PUSH_BINDING(pager_quit_tag_stack, pager_quit_tag, pager_quit_tag_valid);
# 1135|   	if (setjmp(pager_quit_tag) == 0) {
# 1136|   		// push name onto stack

Error: CPPCHECK_WARNING (CWE-457): [#def21]
gawk-5.3.2/debug.c:5623: error[legacyUninitvar]: Uninitialized variable: fatal_tag_stack
# 5621|   	do_flags = false;
# 5622|   
# 5623|-> 	PUSH_BINDING(fatal_tag_stack, fatal_tag, fatal_tag_valid);
# 5624|   	if (setjmp(fatal_tag) == 0) {
# 5625|   		(void) interpret((INSTRUCTION *) code);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
gawk-5.3.2/extension/inplace.c:191:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dup2(mkstemp(state.tname), 1)'
gawk-5.3.2/extension/inplace.c:121:1: enter_function: entry to 'do_inplace_begin'
gawk-5.3.2/extension/inplace.c:144:13: call_function: inlined call to 'invalid_filename' from 'do_inplace_begin'
gawk-5.3.2/extension/inplace.c:151:12: branch_false: following 'false' branch...
gawk-5.3.2/extension/inplace.c:158:15: branch_false: ...to here
gawk-5.3.2/extension/inplace.c:158:12: branch_false: following 'false' branch...
gawk-5.3.2/extension/inplace.c:166:9: branch_false: ...to here
gawk-5.3.2/extension/inplace.c:188:12: branch_false: following 'false' branch...
gawk-5.3.2/extension/inplace.c:191:13: branch_false: ...to here
gawk-5.3.2/extension/inplace.c:191:13: acquire_resource: opened here
gawk-5.3.2/extension/inplace.c:191:12: danger: 'dup2(mkstemp(state.tname), 1)' leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  189|   		fatal(ext_id, _("inplace::begin: dup(stdout) failed (%s)"),
#  190|   			strerror(errno));
#  191|-> 	if (dup2(fd, STDOUT_FILENO) < 0)
#  192|   		fatal(ext_id, _("inplace::begin: dup2(%d, stdout) failed (%s)"),
#  193|   			fd, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def23]
gawk-5.3.2/extension/inplace.c:226:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dup2(state.default_stdout, 1)'
gawk-5.3.2/extension/inplace.c:216:12: branch_false: following 'false' branch...
gawk-5.3.2/extension/inplace.c:219:15: branch_false: ...to here
gawk-5.3.2/extension/inplace.c:219:12: branch_false: following 'false' branch...
gawk-5.3.2/extension/inplace.c:225:9: branch_false: ...to here
gawk-5.3.2/extension/inplace.c:226:13: acquire_resource: opened here
gawk-5.3.2/extension/inplace.c:226:12: danger: 'dup2(state.default_stdout, 1)' leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  224|   
#  225|   	fflush(stdout);
#  226|-> 	if (dup2(state.default_stdout, STDOUT_FILENO) < 0)
#  227|   		fatal(ext_id, _("inplace::end: dup2(%d, stdout) failed (%s)"),
#  228|   			state.default_stdout, strerror(errno));

Error: CPPCHECK_WARNING (CWE-457): [#def24]
gawk-5.3.2/extension/intdiv.c:197: error[uninitvar]: Uninitialized variable: numer_tmp
#  195|   
#  196|   		/* convert numerator and denominator to integer */
#  197|-> 		if (!(numer = mpz_conv(&nv, numer_tmp))) {
#  198|   			warning(ext_id, _("intdiv: numerator is not finite"));
#  199|   			return make_number(-1, result);

Error: CPPCHECK_WARNING (CWE-457): [#def25]
gawk-5.3.2/extension/intdiv.c:201: error[uninitvar]: Uninitialized variable: denom_tmp
#  199|   			return make_number(-1, result);
#  200|   		}
#  201|-> 		if (!(denom = mpz_conv(&dv, denom_tmp))) {
#  202|   			warning(ext_id, _("intdiv: denominator is not finite"));
#  203|   			if (numer == numer_tmp)

Error: COMPILER_WARNING: [#def26]
gawk-5.3.2/extension/readdir.c: scope_hint: In function 'dir_get_record'
gawk-5.3.2/extension/readdir.c:221:27: warning[-Warray-bounds=]: array subscript 1 is above array bounds of 'struct awk_field_info[1]'
#  221 |         the_dir->fw.fields[1].len = flen-1;
#      |         ~~~~~~~~~~~~~~~~~~^~~
gawk-5.3.2/extension/readdir.c:65: included_from: Included from here.
gawk-5.3.2/gawkapi.h:142:11: note: while referencing 'fields'
#  142 |         } fields[1];            /* actual dimension should be nf */
#      |           ^~~~~~
#  219|   	the_dir->fw.fields[0].len = len;
#  220|   	len += (flen = sprintf(the_dir->buf + len, "/%s", dirent->d_name));
#  221|-> 	the_dir->fw.fields[1].len = flen-1;
#  222|   
#  223|   	ftstr = ftype(dirent, iobuf->name);

Error: COMPILER_WARNING: [#def27]
gawk-5.3.2/extension/readdir.c:225:27: warning[-Warray-bounds=]: array subscript 2 is above array bounds of 'struct awk_field_info[1]'
#  225 |         the_dir->fw.fields[2].len = flen-1;
#      |         ~~~~~~~~~~~~~~~~~~^~~
gawk-5.3.2/gawkapi.h:142:11: note: while referencing 'fields'
#  142 |         } fields[1];            /* actual dimension should be nf */
#      |           ^~~~~~
#  223|   	ftstr = ftype(dirent, iobuf->name);
#  224|   	len += (flen = sprintf(the_dir->buf + len, "/%s", ftstr));
#  225|-> 	the_dir->fw.fields[2].len = flen-1;
#  226|   
#  227|   	*out = the_dir->buf;

Error: COMPILER_WARNING: [#def28]
gawk-5.3.2/extension/readdir.c: scope_hint: In function 'dir_take_control_of'
gawk-5.3.2/extension/readdir.c:303:27: warning[-Warray-bounds=]: array subscript 1 is above array bounds of 'struct awk_field_info[1]'
#  303 |         the_dir->fw.fields[1].skip = 1; /* single '/' separator */
#      |         ~~~~~~~~~~~~~~~~~~^~~
gawk-5.3.2/gawkapi.h:142:11: note: while referencing 'fields'
#  142 |         } fields[1];            /* actual dimension should be nf */
#      |           ^~~~~~
#  301|   	the_dir->fw.nf = 3;
#  302|   	the_dir->fw.fields[0].skip = 0;	/* no leading space */
#  303|-> 	the_dir->fw.fields[1].skip = 1;	/* single '/' separator */
#  304|   	the_dir->fw.fields[2].skip = 1;	/* single '/' separator */
#  305|   	size = sizeof(struct dirent) + 21 /* max digits in inode */ + 2 /* slashes */;

Error: COMPILER_WARNING: [#def29]
gawk-5.3.2/extension/readdir.c:304:27: warning[-Warray-bounds=]: array subscript 2 is above array bounds of 'struct awk_field_info[1]'
#  304 |         the_dir->fw.fields[2].skip = 1; /* single '/' separator */
#      |         ~~~~~~~~~~~~~~~~~~^~~
gawk-5.3.2/gawkapi.h:142:11: note: while referencing 'fields'
#  142 |         } fields[1];            /* actual dimension should be nf */
#      |           ^~~~~~
#  302|   	the_dir->fw.fields[0].skip = 0;	/* no leading space */
#  303|   	the_dir->fw.fields[1].skip = 1;	/* single '/' separator */
#  304|-> 	the_dir->fw.fields[2].skip = 1;	/* single '/' separator */
#  305|   	size = sizeof(struct dirent) + 21 /* max digits in inode */ + 2 /* slashes */;
#  306|   	emalloc(the_dir->buf, char *, size, "dir_take_control_of");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def30]
gawk-5.3.2/gawkapi.c:1105:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1103|   	tmp = awk_value_to_node(index);
# 1104|   	elem = awk_value_to_node(value);
# 1105|-> 	if (elem->type == Node_var_array) {
# 1106|   		elem->parent_array = array;
# 1107|   		elem->vname = estrdup(index->str_value.str,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
gawk-5.3.2/io.c:4641:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup(pipefds[0])’
gawk-5.3.2/io.c:4626:12: branch_false: following ‘false’ branch...
gawk-5.3.2/io.c:4629:13: branch_false: ...to here
gawk-5.3.2/io.c:4637:12: branch_true: following ‘true’ branch (when ‘childpid == 0’)...
gawk-5.3.2/io.c:4639:24: branch_true: ...to here
gawk-5.3.2/io.c:4641:21: acquire_resource: opened here
gawk-5.3.2/io.c:4641:20: danger: ‘dup(pipefds[0])’ leaks here; was opened at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
# 4639|   		(void) close(pipefds[1]);	// close write end in the child
# 4640|   		(void) close(0);
# 4641|-> 		if (dup(pipefds[0]) != 0)
# 4642|   			fatal(_("gawk_popen_write: failed to move pipe fd to standard input"));
# 4643|   		(void) close(pipefds[0]);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def32]
gawk-5.3.2/main.c:1301:25: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
gawk-5.3.2/main.c:211:1: enter_function: entry to ‘main’
gawk-5.3.2/main.c:223:35: call_function: calling ‘enable_pma’ from ‘main’
gawk-5.3.2/main.c:223:35: return_function: returning to ‘main’ from ‘enable_pma’
gawk-5.3.2/main.c:241:12: branch_false: following ‘false’ branch...
gawk-5.3.2/main.c:244:19: branch_false: ...to here
gawk-5.3.2/main.c:1291:1: enter_function: entry to ‘catchsig’
gawk-5.3.2/main.c:1293:12: branch_false: following ‘false’ branch (when ‘sig != 8’)...
gawk-5.3.2/main.c:1295:20: branch_false: ...to here
gawk-5.3.2/main.c:1295:19: branch_true: following ‘true’ branch...
gawk-5.3.2/main.c:1300:21: branch_true: ...to here
gawk-5.3.2/main.c:1300:20: branch_true: following ‘true’ branch...
gawk-5.3.2/main.c:1301:25: branch_true: ...to here
gawk-5.3.2/main.c:1301:25: danger: call to ‘exit’ from within signal handler
# 1299|   	) {
# 1300|   		if (errcount > 0)	// assume a syntax error corrupted our data structures
# 1301|-> 			exit(EXIT_FATAL);
# 1302|   
# 1303|   		set_loc(__FILE__, __LINE__);

Error: CPPCHECK_WARNING (CWE-823): [#def33]
gawk-5.3.2/mpfr.c:641: error[arrayIndexOutOfBounds]: Array 'ieee_fmts[5]' accessed at index 5, which is out of bounds.
#  639|   
#  640|   		if (i < j) {
#  641|-> 			prec = ieee_fmts[i].precision;
#  642|   
#  643|   			/*

Error: CPPCHECK_WARNING (CWE-823): [#def34]
gawk-5.3.2/mpfr.c:647: error[arrayIndexOutOfBounds]: Array 'ieee_fmts[5]' accessed at index 5, which is out of bounds.
#  645|   			 * mpfr_set_{emin, emax} here. See format_ieee() for details.
#  646|   			 */
#  647|-> 			max_exp = ieee_fmts[i].emax;
#  648|   			min_exp = ieee_fmts[i].emin;
#  649|   

Error: CPPCHECK_WARNING (CWE-823): [#def35]
gawk-5.3.2/mpfr.c:648: error[arrayIndexOutOfBounds]: Array 'ieee_fmts[5]' accessed at index 5, which is out of bounds.
#  646|   			 */
#  647|   			max_exp = ieee_fmts[i].emax;
#  648|-> 			min_exp = ieee_fmts[i].emin;
#  649|   
#  650|   			do_ieee_fmt = true;

Error: CPPCHECK_WARNING (CWE-628): [#def36]
gawk-5.3.2/node.c:1130: error[invalidFunctionArg]: Invalid sqrt() argument nr 1. The value is -1 but the valid values are '0.0:'.
# 1128|   		if (first) {
# 1129|   			first = false;
# 1130|-> 			nan = sqrt(-1.0);
# 1131|   			inf = -log(0.0);
# 1132|   		}

Error: CPPCHECK_WARNING (CWE-628): [#def37]
gawk-5.3.2/node.c:1131: error[invalidFunctionArg]: Invalid log() argument nr 1. The value is 0 but the valid values are '4.94066e-324:'.
# 1129|   			first = false;
# 1130|   			nan = sqrt(-1.0);
# 1131|-> 			inf = -log(0.0);
# 1132|   		}
# 1133|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
gawk-5.3.2/str_array.c:853:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  851|   	assert(val != NULL);
#  852|   
#  853|-> 	newval = (*val)->stptr;
#  854|   	if (newval == NULL)
#  855|   		newval = "";

Error: CPPCHECK_WARNING (CWE-758): [#def39]
gawk-5.3.2/support/malloc/dynarray_emplace_enlarge.c:59: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
#   57|   
#   58|     size_t new_size;
#   59|->   if (INT_MULTIPLY_WRAPV (new_allocated, element_size, &new_size))
#   60|       return false;
#   61|     void *new_array;

Error: CPPCHECK_WARNING (CWE-758): [#def40]
gawk-5.3.2/support/malloc/dynarray_resize.c:45: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
#   43|   
#   44|     size_t new_size_bytes;
#   45|->   if (INT_MULTIPLY_WRAPV (size, element_size, &new_size_bytes))
#   46|       {
#   47|         /* Overflow.  */

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-253.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namegawk-5.3.2-1.fc43
store-results-to/tmp/tmp_hqb4h9x/gawk-5.3.2-1.fc43.tar.xz
time-created2025-04-25 12:42:37
time-finished2025-04-25 12:46:06
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmp_hqb4h9x/gawk-5.3.2-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp_hqb4h9x/gawk-5.3.2-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9