libedit-3.1-51.20240517cvs.fc41

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1]
libedit-3.1-build/libedit-20240517-3.1/examples/fileman.c: scope_hint: In function ‘dupstr’
libedit-3.1-build/libedit-20240517-3.1/examples/fileman.c:89:4: warning[-Wanalyzer-null-argument]: use of NULL ‘xmalloc(strlen(s) + 1)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#   87|   
#   88|      r = xmalloc (strlen (s) + 1);
#   89|->    strcpy (r, s);
#   90|      return (r);
#   91|   }

Error: CPPCHECK_WARNING: [#def2]
libedit-3.1-build/libedit-20240517-3.1/examples/tc1.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def3]
libedit-3.1-build/libedit-20240517-3.1/examples/tc1.c: scope_hint: In function ‘complete’
libedit-3.1-build/libedit-20240517-3.1/examples/tc1.c:110:19: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘opendir(".")’ where non-null expected
libedit-3.1-build/libedit-20240517-3.1/examples/tc1.c:59: included_from: Included from here.
/usr/include/dirent.h:164:23: note: argument 1 of ‘readdir’ must be non-null
#  108|   	len = lf->cursor - ++ptr;
#  109|   
#  110|-> 	for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
#  111|   		if (len > strlen(dp->d_name))
#  112|   			continue;

Error: CLANG_WARNING: [#def4]
libedit-3.1-build/libedit-20240517-3.1/examples/tc1.c:235:3: warning[deadcode.DeadStores]: Value stored to 'ncontinuation' is never read
#  233|   
#  234|   		continuation = ncontinuation;
#  235|-> 		ncontinuation = 0;
#  236|   		if (continuation)
#  237|   			continue;

Error: CPPCHECK_WARNING: [#def5]
libedit-3.1-build/libedit-20240517-3.1/examples/wtc1.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
libedit-3.1-build/libedit-20240517-3.1/examples/wtc1.c: scope_hint: In function ‘complete’
libedit-3.1-build/libedit-20240517-3.1/examples/wtc1.c:70:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(".")’
#   68|   
#   69|   	/* Find the last word */
#   70|-> 	for (ptr = lf->cursor -1; !iswspace(*ptr) && ptr > lf->buffer; --ptr)
#   71|   		continue;
#   72|   	len = lf->cursor - ++ptr;

Error: COMPILER_WARNING (CWE-252): [#def7]
libedit-3.1-build/libedit-20240517-3.1/examples/wtc1.c: scope_hint: In function ‘complete’
libedit-3.1-build/libedit-20240517-3.1/examples/wtc1.c:75:9: warning[-Wunused-result]: ignoring return value of ‘wctomb’ declared with attribute ‘warn_unused_result’
#   75 |         wctomb(NULL, 0); /* Reset shift state */
#      |         ^~~~~~~~~~~~~~~
#   73|   
#   74|   	/* Convert last word to multibyte encoding, so we can compare to it */
#   75|-> 	wctomb(NULL, 0); /* Reset shift state */
#   76|   	mblen = MB_LEN_MAX * len + 1;
#   77|   	buf = bptr = malloc(mblen);

Error: CPPCHECK_WARNING (CWE-456): [#def8]
libedit-3.1-build/libedit-20240517-3.1/examples/wtc1.c:85: error[uninitdata]: Memory is allocated but not initialized: bptr
#   83|   	for (i = 0; i < len; ++i) {
#   84|   		/* Note: really should test for -1 return from wctomb */
#   85|-> 		bptr += wctomb(bptr, ptr[i]);
#   86|   	}
#   87|   	*bptr = 0; /* Terminate multibyte string */

Error: GCC_ANALYZER_WARNING (CWE-688): [#def9]
libedit-3.1-build/libedit-20240517-3.1/examples/wtc1.c:91:19: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘opendir(".")’ where non-null expected
libedit-3.1-build/libedit-20240517-3.1/examples/wtc1.c:3: included_from: Included from here.
/usr/include/dirent.h:164:23: note: argument 1 of ‘readdir’ must be non-null
#   89|   
#   90|   	/* Scan directory for matching name */
#   91|-> 	for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
#   92|   		if (mblen > strlen(dp->d_name))
#   93|   			continue;

Error: CLANG_WARNING: [#def10]
libedit-3.1-build/libedit-20240517-3.1/examples/wtc1.c:200:3: warning[deadcode.DeadStores]: Value stored to 'ncontinuation' is never read
#  198|   
#  199|   		continuation = ncontinuation;
#  200|-> 		ncontinuation = 0;
#  201|   		if(continuation)
#  202|   			continue;

Error: COMPILER_WARNING (CWE-252): [#def11]
libedit-3.1-build/libedit-20240517-3.1/src/chartype.c: scope_hint: In function 'ct_encode_char'
libedit-3.1-build/libedit-20240517-3.1/src/chartype.c:209:17: warning[-Wunused-result]: ignoring return value of 'wctomb' declared with attribute 'warn_unused_result'
#  209 |                 wctomb(NULL, L'\0');
#      |                 ^~~~~~~~~~~~~~~~~~~
#  207|   
#  208|   	if (l < 0) {
#  209|-> 		wctomb(NULL, L'\0');
#  210|   		l = 0;
#  211|   	}

Error: CLANG_WARNING: [#def12]
libedit-3.1-build/libedit-20240517-3.1/src/chartype.c:227:2: warning[deadcode.DeadStores]: Value stored to 'used' is never read
#  225|   		return NULL;
#  226|   
#  227|-> 	used = 0;
#  228|   	dst = conv->wbuff;
#  229|   	while (*s) {

Error: CLANG_WARNING: [#def13]
libedit-3.1-build/libedit-20240517-3.1/src/el.c:302:4: warning[deadcode.DeadStores]: Value stored to 'rv' is never read
#  300|   
#  301|   		default:
#  302|-> 			rv = -1;
#  303|   			EL_ABORT((el->el_errfile, "Bad op %d\n", op));
#  304|   			break;

Error: CLANG_WARNING: [#def14]
libedit-3.1-build/libedit-20240517-3.1/src/el.c:584:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'fname'
#  582|   	}
#  583|   	if (fname[0] == '\0')
#  584|-> 		return -1;
#  585|   
#  586|   	if (fp == NULL)

Error: GCC_ANALYZER_WARNING (CWE-415): [#def15]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:57: included_from: Included from here.
libedit-3.1-build/libedit-20240517-3.1/src/readline.c: scope_hint: In function 'getfrom'
libedit-3.1-build/libedit-20240517-3.1/src/el.h:96:25: warning[-Wanalyzer-double-free]: double-'free' of 'from'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:710:33: note: in expansion of macro 'el_free'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/el.h:95:36: note: in definition of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1026:41: note: in expansion of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:696:22: note: in expansion of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:696:22: note: in expansion of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/el.h:95:36: note: in definition of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:707:33: note: in expansion of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:709:33: note: in expansion of macro 'el_free'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:710:33: note: in expansion of macro 'el_free'
#   94|   #define	el_calloc(a,b)	calloc(a, b)
#   95|   #define	el_realloc(a,b)	realloc(a, b)
#   96|-> #define	el_free(a)	free(a)
#   97|   
#   98|   #include "tty.h"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
libedit-3.1-build/libedit-20240517-3.1/src/el.h:96:25: warning[-Wanalyzer-malloc-leak]: leak of 'wcsdup(*<unknown>)'
libedit-3.1-build/libedit-20240517-3.1/src/eln.c:230:17: note: in expansion of macro 'el_free'
libedit-3.1-build/libedit-20240517-3.1/src/eln.c:230:17: note: in expansion of macro 'el_free'
#   94|   #define	el_calloc(a,b)	calloc(a, b)
#   95|   #define	el_realloc(a,b)	realloc(a, b)
#   96|-> #define	el_free(a)	free(a)
#   97|   
#   98|   #include "tty.h"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
libedit-3.1-build/libedit-20240517-3.1/src/eln.c:38: included_from: Included from here.
libedit-3.1-build/libedit-20240517-3.1/src/eln.c: scope_hint: In function 'el_set'
libedit-3.1-build/libedit-20240517-3.1/src/el.h:96:25: warning[-Wanalyzer-malloc-leak]: leak of 'wcsdup(<unknown>[1])'
libedit-3.1-build/libedit-20240517-3.1/src/eln.c:230:17: note: in expansion of macro 'el_free'
libedit-3.1-build/libedit-20240517-3.1/src/eln.c:230:17: note: in expansion of macro 'el_free'
#   94|   #define	el_calloc(a,b)	calloc(a, b)
#   95|   #define	el_realloc(a,b)	realloc(a, b)
#   96|-> #define	el_free(a)	free(a)
#   97|   
#   98|   #include "tty.h"

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c: scope_hint: In function 'stifle_history'
libedit-3.1-build/libedit-20240517-3.1/src/el.h:96:25: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1252:25: note: in expansion of macro 'el_free'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1570:19: note: in expansion of macro 'el_malloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1252:25: note: in expansion of macro 'el_free'
#   94|   #define	el_calloc(a,b)	calloc(a, b)
#   95|   #define	el_realloc(a,b)	realloc(a, b)
#   96|-> #define	el_free(a)	free(a)
#   97|   
#   98|   #include "tty.h"

Error: CLANG_WARNING: [#def19]
libedit-3.1-build/libedit-20240517-3.1/src/filecomplete.c:480:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'retstr'
#  478|   			    match_list_len * sizeof(*nmatch_list));
#  479|   			if (nmatch_list == NULL) {
#  480|-> 				el_free(match_list);
#  481|   				return NULL;
#  482|   			}

Error: CLANG_WARNING: [#def20]
libedit-3.1-build/libedit-20240517-3.1/src/history.c:553:3: warning[unix.Malloc]: Use of memory after it is freed
#  551|            */
#  552|   	while (h->cur > h->max && h->cur > 0)
#  553|-> 		history_def_delete(h, ev, h->list.prev);
#  554|   
#  555|   	return 1;

Error: CLANG_WARNING: [#def21]
libedit-3.1-build/libedit-20240517-3.1/src/history.c:594:3: warning[unix.Malloc]: Use of memory after it is freed
#  592|   
#  593|   	while (h->list.prev != &h->list)
#  594|-> 		history_def_delete(h, ev, h->list.prev);
#  595|   	h->cursor = &h->list;
#  596|   	h->eventid = 0;

Error: CLANG_WARNING: [#def22]
libedit-3.1-build/libedit-20240517-3.1/src/read.c:170:3: warning[deadcode.DeadStores]: Value stored to 'e' is never read
#  168|   #endif /* POSIX && EAGAIN */
#  169|   
#  170|-> 		e = 0;
#  171|   #ifdef TRY_AGAIN
#  172|   #if defined(F_SETFL) && defined(O_NDELAY)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
libedit-3.1-build/libedit-20240517-3.1/src/read.c: scope_hint: In function 'el_wpush'
libedit-3.1-build/libedit-20240517-3.1/src/read.c:215:20: warning[-Wanalyzer-malloc-leak]: leak of 'wcsdup(str)'
#  213|   	if (str != NULL && ma->level + 1 < EL_MAXMACRO) {
#  214|   		ma->level++;
#  215|-> 		if ((ma->macro[ma->level] = wcsdup(str)) != NULL)
#  216|   			return;
#  217|   		ma->level--;

Error: CLANG_WARNING: [#def24]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:710:5: warning[unix.Malloc]: Attempt to free released memory
#  708|   			if (nwhat == NULL) {
#  709|   				el_free(what);
#  710|-> 				el_free(*fromp);
#  711|   				*cmdp = cmd;
#  712|   				*fromp = NULL;

Error: CLANG_WARNING: [#def25]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:789:2: warning[unix.Malloc]: Potential memory leak
#  787|   	return 1;
#  788|   out:
#  789|-> 	el_free(with);
#  790|   	el_free(*top);
#  791|   	*top = NULL;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def26]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c: scope_hint: In function 'replace'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:800:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'tmp' where non-null expected
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/el.h:95:36: note: in definition of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1026:41: note: in expansion of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:50: included_from: Included from here.
/usr/include/string.h:273:14: note: argument 1 of 'strrchr' must be non-null
#  798|   {
#  799|   	char *aptr;
#  800|-> 	if ((aptr = strrchr(*tmp, c)) == NULL)
#  801|   		return;
#  802|   	aptr = strdup(aptr + 1); // XXX: check

Error: GCC_ANALYZER_WARNING (CWE-688): [#def27]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c: scope_hint: In function '_history_expand_command'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:937:37: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'tmp' where non-null expected
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/el.h:95:36: note: in definition of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1026:41: note: in expansion of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
/usr/include/string.h:273:14: note: argument 1 of 'strrchr' must be non-null
#  935|   			continue;
#  936|   		case 'h':	/* remove trailing path */
#  937|-> 			if ((aptr = strrchr(tmp, '/')) != NULL)
#  938|   				*aptr = '\0';
#  939|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def28]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:944:37: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'tmp' where non-null expected
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/el.h:95:36: note: in definition of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1026:41: note: in expansion of macro 'el_realloc'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:17: note: in expansion of macro 'ADD_STRING'
/usr/include/string.h:273:14: note: argument 1 of 'strrchr' must be non-null
#  942|   			continue;
#  943|   		case 'r':	/* remove trailing suffix */
#  944|-> 			if ((aptr = strrchr(tmp, '.')) != NULL)
#  945|   				*aptr = '\0';
#  946|   			continue;

Error: CLANG_WARNING: [#def29]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1080:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'result'
# 1078|   		}
# 1079|   		len = i - start;
# 1080|-> 		ADD_STRING(&str[start], len, NULL);
# 1081|   
# 1082|   		if (str[i] == '\0' || str[i] != history_expansion_char) {

Error: CLANG_WARNING: [#def30]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1084:4: warning[unix.Malloc]: Potential leak of memory pointed to by 'result'
# 1082|   		if (str[i] == '\0' || str[i] != history_expansion_char) {
# 1083|   			len = j - i;
# 1084|-> 			ADD_STRING(&str[i], len, NULL);
# 1085|   			if (start == 0)
# 1086|   				ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-127): [#def31]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c: scope_hint: In function 'history_truncate_file'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1351:12: warning[-Wanalyzer-out-of-bounds]: stack-based buffer under-read
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:41: included_from: Included from here.
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1351:12: note: valid subscripts for 'buf' are '[0]' to '[4095]'
#  └───────────────────────┘
#              ^
# 1349|   		goto out3;
# 1350|   	cp = buf + left - 1;
# 1351|-> 	if(*cp != '\n')
# 1352|   		cp++;
# 1353|   	for(;;) {

Error: GCC_ANALYZER_WARNING (CWE-127): [#def32]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1355:29: warning[-Wanalyzer-out-of-bounds]: stack-based buffer under-read
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1355:29: note: valid subscripts for 'buf' are '[0]' to '[4095]'
#  └───────────────────────┘
#              ^
# 1353|   	for(;;) {
# 1354|   		while (--cp >= buf) {
# 1355|-> 			if (*cp == '\n') {
# 1356|   				if (--nlines == 0) {
# 1357|   					if (++cp >= buf + sizeof(buf)) {

Error: COMPILER_WARNING (CWE-252): [#def33]
libedit-3.1-build/libedit-20240517-3.1/src/readline.c: scope_hint: In function 'history_truncate_file'
libedit-3.1-build/libedit-20240517-3.1/src/readline.c:1410:23: warning[-Wunused-result]: ignoring return value of 'ftruncate' declared with attribute 'warn_unused_result'
# 1410 |                 (void)ftruncate(fileno(fp), off);
#      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
# 1408|   	fflush(fp);
# 1409|   	if((off = ftello(fp)) > 0)
# 1410|-> 		(void)ftruncate(fileno(fp), off);
# 1411|   out3:
# 1412|   	fclose(tp);

Error: CPPCHECK_WARNING (CWE-401): [#def34]
libedit-3.1-build/libedit-20240517-3.1/src/reallocarr.c:94: error[memleak]: Memory leak: nptr
#   92|   	}
#   93|   	errno = saved_errno;
#   94|-> 	return result;
#   95|   }
#   96|   #endif

Error: CLANG_WARNING: [#def35]
libedit-3.1-build/libedit-20240517-3.1/src/search.c:464:2: warning[deadcode.DeadStores]: Value stored to 'tmplen' is never read
#  462|   	tmpbuf[1] = '*';
#  463|   #endif
#  464|-> 	tmplen = LEN;
#  465|   
#  466|   	el->el_search.patdir = dir;

Error: CLANG_WARNING: [#def36]
libedit-3.1-build/libedit-20240517-3.1/src/tokenizern.c:3: included_from: Included from here.
libedit-3.1-build/libedit-20240517-3.1/src/tokenizer.c:216:2: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read
#  214|   
#  215|   	cc = co = -1;
#  216|-> 	ptr = line->buffer;
#  217|   	for (ptr = line->buffer; ;ptr++) {
#  218|   		if (ptr >= line->lastchar)

Error: CPPCHECK_WARNING: [#def37]
libedit-3.1-build/libedit-20240517-3.1/src/unvis.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING (CWE-252): [#def38]
libedit-3.1-build/libedit-20240517-3.1/src/vi.c: scope_hint: In function 'vi_histedit'
libedit-3.1-build/libedit-20240517-3.1/src/vi.c:1036:9: warning[-Wunused-result]: ignoring return value of 'write' declared with attribute 'warn_unused_result'
# 1036 |         write(fd, cp, len);
#      |         ^~~~~~~~~~~~~~~~~~
# 1034|   	cp[TMP_BUFSIZ - 1] = '\0';
# 1035|   	len = strlen(cp);
# 1036|-> 	write(fd, cp, len);
# 1037|   	write(fd, "\n", (size_t)1);
# 1038|   	pid = fork();

Error: COMPILER_WARNING (CWE-252): [#def39]
libedit-3.1-build/libedit-20240517-3.1/src/vi.c:1037:9: warning[-Wunused-result]: ignoring return value of 'write' declared with attribute 'warn_unused_result'
# 1037 |         write(fd, "\n", (size_t)1);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
# 1035|   	len = strlen(cp);
# 1036|   	write(fd, cp, len);
# 1037|-> 	write(fd, "\n", (size_t)1);
# 1038|   	pid = fork();
# 1039|   	switch (pid) {

Error: CPPCHECK_WARNING: [#def40]
libedit-3.1-build/libedit-20240517-3.1/src/vis.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-210.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibedit-3.1-51.20240517cvs.fc41
store-results-to/tmp/tmpg8_e4zqd/libedit-3.1-51.20240517cvs.fc41.tar.xz
time-created2024-07-03 14:39:42
time-finished2024-07-03 14:40:51
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpg8_e4zqd/libedit-3.1-51.20240517cvs.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpg8_e4zqd/libedit-3.1-51.20240517cvs.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9