Task #55404 - added.err

back to task #55404
download
Error: CPPCHECK_WARNING (CWE-401):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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|   	}