Task #55404 - fixed.err

back to task #55404
download
Error: COMPILER_WARNING:
ksh-1.0.10/arch/linux.i386-64/include/ast/ast_std.h:34: included_from: Included from here.
ksh-1.0.10/arch/linux.i386-64/include/ast/ast.h:32: included_from: Included from here.
ksh-1.0.10/arch/linux.i386-64/src/cmd/ksh93/8f1438473.c:2: included_from: Included from here.
ksh-1.0.10/arch/linux.i386-64/include/ast/ast_standards.h:12:9: warning: 'basename' redefined
ksh-1.0.10/arch/linux.i386-64/include/ast/ast_common.h:155: included_from: Included from here.
ksh-1.0.10/arch/linux.i386-64/include/ast/bytesex.h:27: included_from: Included from here.
ksh-1.0.10/arch/linux.i386-64/include/ast/endian.h:27: included_from: Included from here.
/usr/include/sys/types.h:176: included_from: Included from here.
ksh-1.0.10/arch/linux.i386-64/src/cmd/ksh93/8f1438473.c:1: included_from: Included from here.
ksh-1.0.10/arch/linux.i386-64/include/ast/ast_map.h:12:9: note: this is the location of the previous definition
#   10|   #define _FILE_OFFSET_BITS 64
#   11|   #endif
#   12|-> #define basename	basename	/* avoid string.h defining this in conflict with AST basename(3) */
#   13|   
#   14|   #endif

Error: GCC_ANALYZER_WARNING (CWE-476):
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'run.part.0'
ksh-1.0.10/src/cmd/INIT/mamake.c:171:85: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown>.nxt'
ksh-1.0.10/src/cmd/INIT/mamake.c:1383:33: note: in expansion of macro 'add'
ksh-1.0.10/src/cmd/INIT/mamake.c:439:26: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:439:65: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:439:65: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:1383:33: note: in expansion of macro 'add'
ksh-1.0.10/src/cmd/INIT/mamake.c:1383:33: note: in expansion of macro 'add'
ksh-1.0.10/src/cmd/INIT/mamake.c:1383:33: note: in expansion of macro 'add'
#  169|   #define delimiter(c)	(isspace(c)||(c)==';'||(c)=='('||(c)==')'||(c)=='`'||(c)=='|'||(c)=='&'||(c)=='=')
#  170|   
#  171|-> #define add(b,c)	(((b)->nxt >= (b)->end) ? append(b, "") : NULL, *(b)->nxt++ = (c))
#  172|   #define getsize(b)	((b)->nxt-(b)->buf)
#  173|   #define setsize(b,o)	((b)->nxt=(b)->buf+(o))

Error: GCC_ANALYZER_WARNING (CWE-401):
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'report.part.0'
ksh-1.0.10/src/cmd/INIT/mamake.c:394:46: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'report.part.0'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'report.part.0'
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'report.part.0'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'report.part.0'
#  392|   				fprintf(stderr, "warning: ");
#  393|   			else if (level > 1)
#  394|-> 				state.errors = 1;
#  395|   		}
#  396|   		if (item)

Error: GCC_ANALYZER_WARNING (CWE-476):
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'buffer'
ksh-1.0.10/src/cmd/INIT/mamake.c:441:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'buf'
ksh-1.0.10/src/cmd/INIT/mamake.c:439:26: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:439:26: note: in expansion of macro 'newof'
#  439|   	else if (!(buf = newof(0, Buf_t, 1, 0)) || !(buf->buf = newof(0, char, CHUNK, 0)))
#  440|   		report(3, "out of memory [buffer]", NULL, 0);
#  441|-> 	buf->end = buf->buf + CHUNK;
#  442|   	buf->nxt = buf->buf;
#  443|   	return buf;

Error: GCC_ANALYZER_WARNING (CWE-401):
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'appendn'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:20: warning[-Wanalyzer-malloc-leak]: leak of '*buf.buf'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
#  466|   		i = buf->nxt - buf->buf;
#  467|   		m = (((buf->end - buf->buf) + n + CHUNK + 1) / CHUNK) * CHUNK;
#  468|-> 		if (!(buf->buf = newof(buf->buf, char, m, 0)))
#  469|   			report(3, "out of memory [buffer resize]", NULL, 0);
#  470|   		buf->end = buf->buf + m;

Error: GCC_ANALYZER_WARNING (CWE-401):
ksh-1.0.10/src/cmd/INIT/mamake.c:470:26: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'appendn'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'appendn'
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'appendn'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'appendn'
#  468|   		if (!(buf->buf = newof(buf->buf, char, m, 0)))
#  469|   			report(3, "out of memory [buffer resize]", NULL, 0);
#  470|-> 		buf->end = buf->buf + m;
#  471|   		buf->nxt = buf->buf + i;
#  472|   	}

Error: GCC_ANALYZER_WARNING (CWE-401):
ksh-1.0.10/src/cmd/INIT/mamake.c:471:26: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
ksh-1.0.10/src/cmd/INIT/mamake.c:439:26: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:439:65: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:439:65: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c:468:34: note: in expansion of macro 'newof'
ksh-1.0.10/src/cmd/INIT/mamake.c: scope_hint: In function 'appendn'
#  469|   			report(3, "out of memory [buffer resize]", NULL, 0);
#  470|   		buf->end = buf->buf + m;
#  471|-> 		buf->nxt = buf->buf + i;
#  472|   	}
#  473|   	memcpy(buf->nxt, str, n + 1);

Error: CPPCHECK_WARNING (CWE-682):
ksh-1.0.10/src/cmd/INIT/mamake.c:1749: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
# 1747|   	if (!all)
# 1748|   		report(3, "out of memory [upd_allprev]", NULL, 0);
# 1749|-> 	strcpy(all + nn, name);
# 1750|   	auto_allprev->value = all;
# 1751|   	/* restore ${?}, append to it if rule was updated */

Error: CPPCHECK_WARNING (CWE-682):
ksh-1.0.10/src/cmd/INIT/mamake.c:1760: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
# 1758|   		if (!upd)
# 1759|   			report(3, "out of memory [upd_allprev]", NULL, 0);
# 1760|-> 		strcpy(upd + nn, name);
# 1761|   	}
# 1762|   	auto_updprev->value = upd;

Error: GCC_ANALYZER_WARNING (CWE-401):
ksh-1.0.10/src/cmd/ksh93/sh/init.c:37: included_from: Included from here.
ksh-1.0.10/src/cmd/ksh93/sh/init.c: scope_hint: In function 'nv_init'
ksh-1.0.10/src/cmd/ksh93/include/variables.h:100:28: warning[-Wanalyzer-malloc-leak]: leak of 'sh_calloc(1, 40)'
ksh-1.0.10/src/cmd/ksh93/sh/init.c:1909:38: note: in expansion of macro 'SH_VERSIONNOD'
ksh-1.0.10/src/cmd/ksh93/sh/init.c:31: included_from: Included from here.
ksh-1.0.10/src/cmd/ksh93/sh/init.c:1802:22: note: in expansion of macro 'sh_newof'
ksh-1.0.10/src/cmd/ksh93/sh/init.c:1802:22: note: in expansion of macro 'sh_newof'
ksh-1.0.10/src/cmd/ksh93/sh/init.c:1908:34: note: in expansion of macro 'sh_newof'
ksh-1.0.10/src/cmd/ksh93/sh/init.c:1908:34: note: in expansion of macro 'sh_newof'
ksh-1.0.10/src/cmd/ksh93/sh/init.c:1909:38: note: in expansion of macro 'SH_VERSIONNOD'
#   98|   #define SH_SUBSCRNOD	(sh.bltin_nodes+50)
#   99|   #define SH_VALNOD	(sh.bltin_nodes+51)
#  100|-> #define SH_VERSIONNOD	(sh.bltin_nodes+52)
#  101|   #define SH_MATCHNOD	(sh.bltin_nodes+53)
#  102|   #define SH_COMMANDNOD	(sh.bltin_nodes+54)

Error: CPPCHECK_WARNING (CWE-682):
ksh-1.0.10/src/cmd/ksh93/sh/parse.c:1959: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1957|   	    case '(':
# 1958|   		t = test_expr(lexp,')');
# 1959|-> 		t = makelist(lexp,TTST|TTEST|TPAREN ,t, (Shnode_t*)pointerof(sh.inlineno));
# 1960|   		break;
# 1961|   	    case '!':

Error: GCC_ANALYZER_WARNING (CWE-476):
ksh-1.0.10/src/lib/libast/comp/regcmp.c: scope_hint: In function '_ast_regcmp'
ksh-1.0.10/src/lib/libast/comp/regcmp.c:75:25: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#   73|   
#   74|   	va_start(ap, pattern);
#   75|-> 	if (pattern || !*pattern || !(sp = sfstropen()))
#   76|   		e = 1;
#   77|   	else

Error: CPPCHECK_WARNING (CWE-682):
ksh-1.0.10/src/lib/libast/disc/sfkeyprintf.c:232: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  230|   		if (s)
#  231|   			n = strtoll(s, NULL, 0);
#  232|-> 		value->p = pointerof(n);
#  233|   		break;
#  234|   	case 'q':

Error: CPPCHECK_WARNING (CWE-476):
ksh-1.0.10/src/lib/libast/misc/magic.c:2048: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ep->value.loop
# 2046|   					{
# 2047|   						ep->value.loop = calloc(1, sizeof(Loop_t));
# 2048|-> 						ep->value.loop->lab = fun[n];
# 2049|   						while (*p && *p++ != ',');
# 2050|   						ep->value.loop->start = strton(p, &t, NULL, 0);

Error: GCC_ANALYZER_WARNING (CWE-476):
ksh-1.0.10/src/lib/libast/misc/magic.c: scope_hint: In function 'magiclist'
ksh-1.0.10/src/lib/libast/misc/magic.c:2407:28: warning[-Wanalyzer-null-dereference]: dereference of NULL 'ep'
# 2405|   				ep->value.lab->mask = 1;
# 2406|   			}
# 2407|-> 			ep = ep->next;
# 2408|   		}
# 2409|   	}

Error: CPPCHECK_WARNING (CWE-476):
ksh-1.0.10/src/lib/libast/misc/optget.c:4145: error[ctunullpointer]: Null pointer dereference: e
# 4143|   		n = strtonll(s, t, &lastbase, 0);
# 4144|   	}
# 4145|-> 	*e = errno;
# 4146|   	errno = oerrno;
# 4147|   	return n;

Error: CPPCHECK_WARNING (CWE-476):
ksh-1.0.10/src/lib/libast/misc/optget.c:4145: warning[nullPointer]: Possible null pointer dereference: e
# 4143|   		n = strtonll(s, t, &lastbase, 0);
# 4144|   	}
# 4145|-> 	*e = errno;
# 4146|   	errno = oerrno;
# 4147|   	return n;

Error: COMPILER_WARNING (CWE-562):
ksh-1.0.10/src/lib/libast/path/pathkey.c: scope_hint: In function 'pathkey_20100601'
ksh-1.0.10/src/lib/libast/path/pathkey.c:289:41: warning[-Wreturn-local-addr]: function may return address of local variable
#  289 |         return key == buf ? strdup(key) : key;
#      |                                         ^
ksh-1.0.10/src/lib/libast/path/pathkey.c:58:25: note: declared here
#   58 |         char            buf[15];
#      |                         ^
#  287|   #pragma GCC diagnostic ignored "-Wreturn-local-addr"
#  288|   #endif
#  289|-> 	return key == buf ? strdup(key) : key;
#  290|   }

Error: GCC_ANALYZER_WARNING (CWE-457):
ksh-1.0.10/src/lib/libast/regex/regrexec.c: scope_hint: In function '_ast_regrexec'
ksh-1.0.10/src/lib/libast/regex/regrexec.c:166:61: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*<unknown>.rm_so'
ksh-1.0.10/src/lib/libast/regex/regrexec.c:153:1: note: in expansion of macro 'regrexec'
ksh-1.0.10/src/lib/libast/regex/reglib.h:56: included_from: Included from here.
ksh-1.0.10/src/lib/libast/regex/regrexec.c:26: included_from: Included from here.
ksh-1.0.10/src/lib/libast/regex/regrexec.c:161:31: note: in expansion of macro 'oldof'
ksh-1.0.10/src/lib/libast/regex/regrexec.c:161:31: note: in expansion of macro 'oldof'
#  164|   			for (i = 0; i < nmatch; i++)
#  165|   			{
#  166|-> 				oldmatch[i].rm_so = match[i].rm_so;
#  167|   				oldmatch[i].rm_eo = match[i].rm_eo;
#  168|   			}