Newly introduced findings

List of Findings

Error: CPPCHECK_WARNING (CWE-401): [#def1]
ksh-1.0.11/src/cmd/INIT/mamake.c:1024: error[memleakOnRealloc]: Common realloc mistake: 'argv' nulled but not freed upon failure
# 1022|   						n++;
# 1023|   						c = *q, *q = 0;  /* terminate for duplicate() */
# 1024|-> 						if (!(argv = realloc(argv, (n+1)*sizeof(char*))) || !(argv[n-1] = duplicate(a)))
# 1025|   							out_of_memory();
# 1026|   						*q = c;

Error: CPPCHECK_WARNING (CWE-476): [#def2]
ksh-1.0.11/src/cmd/INIT/mamake.c:1960: error[nullPointer]: Null pointer dereference
# 1958|   			append(tmp, "/lib/lib/");
# 1959|   			append(tmp, lib + 2);
# 1960|-> 			f = fopen(use(tmp), "r");
# 1961|   		}
# 1962|   		if (f)

Error: CPPCHECK_WARNING (CWE-476): [#def3]
ksh-1.0.11/src/cmd/builtin/pty.c:1094: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ap
# 1092|   				n++;
# 1093|   		ap = newof(0, Argv_t, 1, (n + 2) * sizeof(char*) + (s - stty + 1));
# 1094|-> 		ap->argc = n + 1;
# 1095|   		ap->argv = (char**)(ap + 1);
# 1096|   		ap->args = (char*)(ap->argv + n + 2);

Error: CPPCHECK_WARNING (CWE-682): [#def4]
ksh-1.0.11/src/cmd/builtin/pty.c:1095: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
# 1093|   		ap = newof(0, Argv_t, 1, (n + 2) * sizeof(char*) + (s - stty + 1));
# 1094|   		ap->argc = n + 1;
# 1095|-> 		ap->argv = (char**)(ap + 1);
# 1096|   		ap->args = (char*)(ap->argv + n + 2);
# 1097|   		strcpy(ap->args, stty);

Error: CPPCHECK_WARNING (CWE-476): [#def5]
ksh-1.0.11/src/cmd/builtin/pty.c:1095: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ap
# 1093|   		ap = newof(0, Argv_t, 1, (n + 2) * sizeof(char*) + (s - stty + 1));
# 1094|   		ap->argc = n + 1;
# 1095|-> 		ap->argv = (char**)(ap + 1);
# 1096|   		ap->args = (char*)(ap->argv + n + 2);
# 1097|   		strcpy(ap->args, stty);

Error: CPPCHECK_WARNING (CWE-476): [#def6]
ksh-1.0.11/src/cmd/builtin/pty.c:1096: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ap
# 1094|   		ap->argc = n + 1;
# 1095|   		ap->argv = (char**)(ap + 1);
# 1096|-> 		ap->args = (char*)(ap->argv + n + 2);
# 1097|   		strcpy(ap->args, stty);
# 1098|   		ap->argv[0] = "stty";

Error: CPPCHECK_WARNING (CWE-476): [#def7]
ksh-1.0.11/src/cmd/builtin/pty.c:1097: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ap
# 1095|   		ap->argv = (char**)(ap + 1);
# 1096|   		ap->args = (char*)(ap->argv + n + 2);
# 1097|-> 		strcpy(ap->args, stty);
# 1098|   		ap->argv[0] = "stty";
# 1099|   		sfsprintf(ap->argv[1] = buf, sizeof(buf), "--fd=%d", minion);

Error: CPPCHECK_WARNING (CWE-476): [#def8]
ksh-1.0.11/src/cmd/builtin/pty.c:1098: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ap
# 1096|   		ap->args = (char*)(ap->argv + n + 2);
# 1097|   		strcpy(ap->args, stty);
# 1098|-> 		ap->argv[0] = "stty";
# 1099|   		sfsprintf(ap->argv[1] = buf, sizeof(buf), "--fd=%d", minion);
# 1100|   		ap->argv[2] = s = ap->args;

Error: CPPCHECK_WARNING (CWE-476): [#def9]
ksh-1.0.11/src/cmd/builtin/pty.c:1099: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ap
# 1097|   		strcpy(ap->args, stty);
# 1098|   		ap->argv[0] = "stty";
# 1099|-> 		sfsprintf(ap->argv[1] = buf, sizeof(buf), "--fd=%d", minion);
# 1100|   		ap->argv[2] = s = ap->args;
# 1101|   		for (n = 2; *s; s++)

Error: CPPCHECK_WARNING (CWE-476): [#def10]
ksh-1.0.11/src/cmd/builtin/pty.c:1100: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ap
# 1098|   		ap->argv[0] = "stty";
# 1099|   		sfsprintf(ap->argv[1] = buf, sizeof(buf), "--fd=%d", minion);
# 1100|-> 		ap->argv[2] = s = ap->args;
# 1101|   		for (n = 2; *s; s++)
# 1102|   			if (isspace(*s))

Error: CPPCHECK_WARNING (CWE-476): [#def11]
ksh-1.0.11/src/cmd/ksh93/sh/array.c:1601: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: (uint16_t*)np->nvalue
# 1599|   		if(!np->nvalue)
# 1600|   			np->nvalue = malloc(sizeof(uint16_t));
# 1601|-> 		*((uint16_t*)np->nvalue) = ap->cur;
# 1602|   		return nv_getval(np);
# 1603|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
ksh-1.0.11/src/cmd/ksh93/sh/init.c: scope_hint: In function 'env_init'
ksh-1.0.11/src/cmd/ksh93/sh/init.c:1953:32: warning[-Wanalyzer-malloc-leak]: leak of 'put_lang_defer'
# 1951|   		struct put_lang_defer_s *p = put_lang_defer;
# 1952|   		put_lang(p->np, p->val, p->flags, p->fp);
# 1953|-> 		put_lang_defer = p->next;
# 1954|   		free(p);
# 1955|   	}

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.1.1
analyzer-version-gcc-analyzer15.1.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.86.0
diffbase-analyzer-version-cppcheck2.17.1
diffbase-analyzer-version-gcc15.1.1
diffbase-analyzer-version-gcc-analyzer15.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-95.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250509.165649.g41c6174.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-nameksh-1.0.10-5.fc43
diffbase-store-results-to/tmp/tmpd_ys307q/ksh-1.0.10-5.fc43.tar.xz
diffbase-time-created2025-05-12 14:34:28
diffbase-time-finished2025-05-12 14:42:55
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpd_ys307q/ksh-1.0.10-5.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpd_ys307q/ksh-1.0.10-5.fc43.src.rpm'
diffbase-tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-95.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250509.165649.g41c6174.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameksh-1.0.11-1.fc43
store-results-to/tmp/tmpjmj4balg/ksh-1.0.11-1.fc43.tar.xz
time-created2025-05-12 14:43:07
time-finished2025-05-12 14:50:50
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpjmj4balg/ksh-1.0.11-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpjmj4balg/ksh-1.0.11-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9