nano-8.0-1.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
nano-8.0-build/nano-8.0/lib/mbsrtoc32s.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def2]
nano-8.0-build/nano-8.0/lib/mbsrtowcs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def3]
nano-8.0-build/nano-8.0/lib/printf-parse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def4]
nano-8.0-build/nano-8.0/lib/tempname.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def5]
nano-8.0-build/nano-8.0/lib/utimens.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def6]
nano-8.0-build/nano-8.0/lib/vasnprintf.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def7]
nano-8.0-build/nano-8.0/src/browser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def8]
nano-8.0-build/nano-8.0/src/browser.c:403: warning[uninitvar]: Uninitialized variable: dir
#  401|   		dir = opendir(path);
#  402|   
#  403|-> 	if (path == NULL || dir == NULL) {
#  404|   		statusline(ALERT, _("Cannot open directory: %s"), strerror(errno));
#  405|   		/* If we don't have a file list, there is nothing to show. */

Error: CLANG_WARNING: [#def9]
nano-8.0-build/nano-8.0/src/browser.c:417:10: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value
#  415|   	}
#  416|   
#  417|-> 	if (dir != NULL) {
#  418|   		/* Get the file list, and set gauge and piles in the process. */
#  419|   		read_the_list(path, dir);

Error: CPPCHECK_WARNING: [#def10]
nano-8.0-build/nano-8.0/src/chars.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def11]
nano-8.0-build/nano-8.0/src/color.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def12]
nano-8.0-build/nano-8.0/src/cut.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def13]
nano-8.0-build/nano-8.0/src/files.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def14]
nano-8.0-build/nano-8.0/src/files.c:520:7: warning[core.NullDereference]: Access to field 'filetop' results in a dereference of a null pointer (loaded from variable 'openfile')
#  518|   #ifdef ENABLE_COLOR
#  519|   	/* Precalculate the data for any multiline coloring regexes. */
#  520|-> 	if (!openfile->filetop->multidata)
#  521|   		precalc_multicolorinfo();
#  522|   	have_palette = FALSE;

Error: CLANG_WARNING: [#def15]
nano-8.0-build/nano-8.0/src/files.c:1111:4: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
# 1109|   		/* Create a separate process for piping the data to the command. */
# 1110|   		if ((pid_of_sender = fork()) == 0) {
# 1111|-> 			send_data(whole_buffer ? openfile->filetop : cutbuffer, to_fd[1]);
# 1112|   			exit(0);
# 1113|   		}

Error: CLANG_WARNING: [#def16]
nano-8.0-build/nano-8.0/src/files.c:1118:3: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
# 1116|   			statusline(ALERT, _("Could not fork: %s"), strerror(errno));
# 1117|   
# 1118|-> 		close(to_fd[0]);
# 1119|   		close(to_fd[1]);
# 1120|   

Error: CLANG_WARNING: [#def17]
nano-8.0-build/nano-8.0/src/files.c:1353:9: warning[core.NullDereference]: Access to field 'current' results in a dereference of a null pointer (loaded from variable 'openfile')
# 1351|   			{
# 1352|   				/* If the buffer actually changed, mark it as modified. */
# 1353|-> 				if (openfile->current->lineno != was_current_lineno ||
# 1354|   									openfile->current_x != was_current_x)
# 1355|   					set_modified();

Error: CLANG_WARNING: [#def18]
nano-8.0-build/nano-8.0/src/files.c:1501:35: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1499|   
# 1500|   	free(operating_dir);
# 1501|-> 	operating_dir = nrealloc(target, strlen(target) + 1);
# 1502|   }
# 1503|   

Error: CLANG_WARNING: [#def19]
nano-8.0-build/nano-8.0/src/files.c:1550:32: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1548|   
# 1549|   	free(backup_dir);
# 1550|-> 	backup_dir = nrealloc(target, strlen(target) + 1);
# 1551|   }
# 1552|   #endif

Error: CPPCHECK_WARNING: [#def20]
nano-8.0-build/nano-8.0/src/global.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def21]
nano-8.0-build/nano-8.0/src/global.c:413:16: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'tailsc')
#  411|   		sclist = sc;
#  412|   	else
#  413|-> 		tailsc->next = sc;
#  414|   	sc->next = NULL;
#  415|   

Error: CPPCHECK_WARNING: [#def22]
nano-8.0-build/nano-8.0/src/help.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def23]
nano-8.0-build/nano-8.0/src/history.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def24]
nano-8.0-build/nano-8.0/src/history.c:85:29: warning[core.NullDereference]: Access to field 'prev' results in a dereference of a null pointer (loaded from variable 'end')
#   83|   	const linestruct *item;
#   84|   
#   85|-> 	for (item = start; item != end->prev && item != NULL; item = item->prev) {
#   86|   		if (strncmp(item->data, text, len) == 0)
#   87|   			return (linestruct *)item;

Error: CLANG_WARNING: [#def25]
nano-8.0-build/nano-8.0/src/history.c:403:19: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'lastitem')
#  401|   			position_history = newitem;
#  402|   		else
#  403|-> 			lastitem->next = newitem;
#  404|   
#  405|   		lastitem = newitem;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def26]
nano-8.0-build/nano-8.0/src/history.c: scope_hint: In function ‘load_poshistory’
nano-8.0-build/nano-8.0/src/history.c:403:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lastitem’
#  401|   			position_history = newitem;
#  402|   		else
#  403|-> 			lastitem->next = newitem;
#  404|   
#  405|   		lastitem = newitem;

Error: COMPILER_WARNING: [#def27]
nano-8.0-build/nano-8.0/src/history.c: scope_hint: In function ‘save_poshistory’
nano-8.0-build/nano-8.0/src/history.c:456:44: warning[-Wstringop-overflow=]: writing 1 byte into a region of size 0
#  456 |                 path_and_place[length - 1] = '\n';
#      |                                            ^
nano-8.0-build/nano-8.0/src/utils.c:293:25: note: at offset -1 into destination object of size [44, 9223372036854775807] allocated by ‘malloc’
#  293 |         void *section = malloc(howmuch);
#      |                         ^
#  454|   		length = recode_LF_to_NUL(path_and_place);
#  455|   		/* Restore the terminating newline. */
#  456|-> 		path_and_place[length - 1] = '\n';
#  457|   
#  458|   		if (fwrite(path_and_place, 1, length, histfile) < length)

Error: CLANG_WARNING: [#def28]
nano-8.0-build/nano-8.0/src/history.c:538:19: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'previous')
#  536|   			position_history = theone;
#  537|   		else
#  538|-> 			previous->next = theone;
#  539|   	} else if (item->next != NULL) {
#  540|   		if (previous == NULL)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def29]
nano-8.0-build/nano-8.0/src/history.c: scope_hint: In function ‘update_poshistory’
nano-8.0-build/nano-8.0/src/history.c:538:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘previous’
#  536|   			position_history = theone;
#  537|   		else
#  538|-> 			previous->next = theone;
#  539|   	} else if (item->next != NULL) {
#  540|   		if (previous == NULL)

Error: CPPCHECK_WARNING: [#def30]
nano-8.0-build/nano-8.0/src/move.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def31]
nano-8.0-build/nano-8.0/src/move.c:220:11: warning[core.NullDereference]: Access to field 'prev' results in a dereference of a null pointer
#  218|   
#  219|   	while (!begpar(*line, 0))
#  220|-> 		*line = (*line)->prev;
#  221|   }
#  222|   

Error: CPPCHECK_WARNING: [#def32]
nano-8.0-build/nano-8.0/src/nano.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def33]
nano-8.0-build/nano-8.0/src/nano.c:103:14: warning[core.NullDereference]: Access to field 'edittop' results in a dereference of a null pointer (loaded from variable 'openfile')
#  101|   {
#  102|   	/* If the first line on the screen gets deleted, step one back. */
#  103|-> 	if (line == openfile->edittop)
#  104|   		openfile->edittop = line->prev;
#  105|   #ifdef ENABLE_WRAPPING

Error: CPPCHECK_WARNING: [#def34]
nano-8.0-build/nano-8.0/src/prompt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def35]
nano-8.0-build/nano-8.0/src/prompt.c:560: warning[uninitvar]: Uninitialized variable: input
#  558|   #endif
#  559|   
#  560|-> 	*actual = input;
#  561|   
#  562|   	return function;

Error: CPPCHECK_WARNING: [#def36]
nano-8.0-build/nano-8.0/src/rcfile.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def37]
nano-8.0-build/nano-8.0/src/rcfile.c:787:2: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read
#  785|   
#  786|   	menuptr = ptr;
#  787|-> 	ptr = parse_next_word(ptr);
#  788|   
#  789|   	if (menuptr[0] == '\0') {

Error: CLANG_WARNING: [#def38]
nano-8.0-build/nano-8.0/src/rcfile.c:981:2: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read
#  979|   	if (*pattern == '"')
#  980|   		pattern++;
#  981|-> 	ptr = parse_argument(ptr);
#  982|   
#  983|   	if (strlen(pattern) > PATH_MAX) {

Error: CLANG_WARNING: [#def39]
nano-8.0-build/nano-8.0/src/rcfile.c:1581:3: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read
# 1579|   		if (*argument == '"')
# 1580|   			argument++;
# 1581|-> 		ptr = parse_argument(ptr);
# 1582|   
# 1583|   #ifdef ENABLE_UTF8

Error: CPPCHECK_WARNING: [#def40]
nano-8.0-build/nano-8.0/src/search.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-682): [#def41]
nano-8.0-build/nano-8.0/src/search.c:313: error[nullPointerArithmetic]: Overflow in pointer arithmetic, NULL pointer is subtracted.
#  311|   	}
#  312|   
#  313|-> 	found_x = found - line->data;
#  314|   
#  315|   	nodelay(midwin, FALSE);

Error: CLANG_WARNING: [#def42]
nano-8.0-build/nano-8.0/src/search.c:576:48: warning[core.NullDereference]: Access to field 'lineno' results in a dereference of an undefined pointer value (loaded from variable 'bot')
#  574|   #ifndef NANO_TINY
#  575|   		/* An occurrence outside of the marked region means we're done. */
#  576|-> 		if (was_mark && (openfile->current->lineno > bot->lineno ||
#  577|   								openfile->current->lineno < top->lineno ||
#  578|   								(openfile->current == bot &&

Error: CPPCHECK_WARNING: [#def43]
nano-8.0-build/nano-8.0/src/text.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def44]
nano-8.0-build/nano-8.0/src/text.c: scope_hint: In function ‘do_undo’
nano-8.0-build/nano-8.0/src/text.c:520:60: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘line’
#  518|   			remove_magicline();
#  519|   		memmove(line->data + u->head_x, line->data + u->head_x + strlen(u->strdata),
#  520|-> 						strlen(line->data + u->head_x) - strlen(u->strdata) + 1);
#  521|   		goto_line_posx(u->head_lineno, u->head_x);
#  522|   		break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
nano-8.0-build/nano-8.0/src/text.c:530:62: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘line’
#  528|   		original_x = (u->head_x == 0) ? u->tail_x : u->head_x;
#  529|   		regain_from_x = (u->head_x == 0) ? 0 : u->tail_x;
#  530|-> 		line->data = nrealloc(line->data, strlen(line->data) +
#  531|   								strlen(&u->strdata[regain_from_x]) + 1);
#  532|   		strcat(line->data, &u->strdata[regain_from_x]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def46]
nano-8.0-build/nano-8.0/src/text.c:542:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘line’
#  540|   	case DEL:
#  541|   		undidmsg = _("deletion");
#  542|-> 		data = nmalloc(strlen(line->data) + strlen(u->strdata) + 1);
#  543|   		strncpy(data, line->data, u->head_x);
#  544|   		strcpy(&data[u->head_x], u->strdata);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def47]
nano-8.0-build/nano-8.0/src/text.c:560:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘line’
#  558|   			break;
#  559|   		}
#  560|-> 		line->data[u->tail_x] = '\0';
#  561|   		intruder = make_new_node(line);
#  562|   		intruder->data = copy_of(u->strdata);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def48]
nano-8.0-build/nano-8.0/src/text.c:572:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘line’
#  570|   			remove_magicline();
#  571|   		data = u->strdata;
#  572|-> 		u->strdata = line->data;
#  573|   		line->data = data;
#  574|   		goto_line_posx(u->head_lineno, u->head_x);

Error: CLANG_WARNING: [#def49]
nano-8.0-build/nano-8.0/src/text.c:1683:3: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
# 1681|   		splice_node(*line, make_new_node(*line));
# 1682|   		(*line)->next->data = nmalloc(lead_len + line_len - break_pos + 1);
# 1683|-> 		strncpy((*line)->next->data, lead_string, lead_len);
# 1684|   		strcpy((*line)->next->data + lead_len, (*line)->data + break_pos);
# 1685|   

Error: CLANG_WARNING: [#def50]
nano-8.0-build/nano-8.0/src/text.c:2055:26: warning[core.NullDereference]: Array access results in a null pointer dereference
# 2053|   	}
# 2054|   
# 2055|-> 	(*arguments)[count - 2] = filename;
# 2056|   	(*arguments)[count - 1] = NULL;
# 2057|   }

Error: CLANG_WARNING: [#def51]
nano-8.0-build/nano-8.0/src/text.c:2322:19: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
# 2320|   			openfile->current = openfile->mark;
# 2321|   			openfile->current_x = openfile->mark_x;
# 2322|-> 			openfile->mark = top;
# 2323|   			openfile->mark_x = top_x;
# 2324|   		} else {

Error: CLANG_WARNING: [#def52]
nano-8.0-build/nano-8.0/src/text.c:2325:22: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
# 2323|   			openfile->mark_x = top_x;
# 2324|   		} else {
# 2325|-> 			openfile->current = top;
# 2326|   			openfile->current_x = top_x;
# 2327|   		}

Error: CLANG_WARNING: [#def53]
nano-8.0-build/nano-8.0/src/text.c:2963:2: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 2961|   		treat(temp_name, openfile->syntax->formatter, FALSE);
# 2962|   
# 2963|-> 	unlink(temp_name);
# 2964|   	free(temp_name);
# 2965|   }

Error: CLANG_WARNING: [#def54]
nano-8.0-build/nano-8.0/src/text.c:3241:31: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'scouring')
# 3239|   #ifdef ENABLE_MULTIBUFFER
# 3240|   		/* When at end of buffer and there is another, search that one. */
# 3241|-> 		if (pletion_line == NULL && scouring->next != openfile) {
# 3242|   			scouring = scouring->next;
# 3243|   			pletion_line = scouring->filetop;

Error: CPPCHECK_WARNING: [#def55]
nano-8.0-build/nano-8.0/src/utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def56]
nano-8.0-build/nano-8.0/src/utils.c: scope_hint: In function ‘concatenate’
nano-8.0-build/nano-8.0/src/utils.c:73:9: warning[-Wanalyzer-null-argument]: use of NULL ‘nmalloc(strlen(name) + pathlen + 1)’ where non-null expected
nano-8.0-build/nano-8.0/src/definitions.h:75: included_from: Included from here.
nano-8.0-build/nano-8.0/src/prototypes.h:21: included_from: Included from here.
nano-8.0-build/nano-8.0/src/utils.c:22: included_from: Included from here.
nano-8.0-build/nano-8.0/src/utils.c:296:21: note: in expansion of macro ‘_’
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#   71|   	char *joined = nmalloc(pathlen + strlen(name) + 1);
#   72|   
#   73|-> 	strcpy(joined, path);
#   74|   	strcpy(joined + pathlen, name);
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def57]
nano-8.0-build/nano-8.0/src/utils.c: scope_hint: In function ‘mallocstrcpy’
nano-8.0-build/nano-8.0/src/utils.c:319:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strncpy’ must be non-null
#  317|   
#  318|   	dest = nrealloc(dest, count);
#  319|-> 	strncpy(dest, src, count);
#  320|   
#  321|   	return dest;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def58]
nano-8.0-build/nano-8.0/src/utils.c: scope_hint: In function ‘measured_copy’
nano-8.0-build/nano-8.0/src/utils.c:330:9: warning[-Wanalyzer-null-argument]: use of NULL ‘nmalloc(count + 1)’ where non-null expected
nano-8.0-build/nano-8.0/src/utils.c:296:21: note: in expansion of macro ‘_’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  328|   	char *thecopy = nmalloc(count + 1);
#  329|   
#  330|-> 	memcpy(thecopy, string, count);
#  331|   	thecopy[count] = '\0';
#  332|   

Error: CPPCHECK_WARNING: [#def59]
nano-8.0-build/nano-8.0/src/winio.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def60]
nano-8.0-build/nano-8.0/src/winio.c:2706: warning[uninitvar]: Uninitialized variable: endmatch.rm_eo
# 2704|   			/* Second step: look for starts on this line, but begin
# 2705|   			 * looking only after an end match, if there is one. */
# 2706|-> 			index = (paintlen == 0) ? 0 : endmatch.rm_eo;
# 2707|   
# 2708|   			while (index < PAINT_LIMIT && regexec(varnish->start, line->data + index,

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-187.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namenano-8.0-1.fc41
store-results-to/tmp/tmpqgwdw51o/nano-8.0-1.fc41.tar.xz
time-created2024-07-03 16:19:40
time-finished2024-07-03 16:21:49
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpqgwdw51o/nano-8.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpqgwdw51o/nano-8.0-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9