Task #20847 - buildah-1.37.0-1.20241104130514106205.pr5804.191.g9a5b88d3e/scan-results.err

back to task #20847
download
Error: GCC_ANALYZER_WARNING (CWE-775):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c: scope_hint: In function ‘parse_proc_stringlist’
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c:118:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(list, 0)’
#  116|   		new_size = used + BUFSTEP;
#  117|   		new_buf = realloc(buf, new_size);
#  118|-> 		if (new_buf == NULL) {
#  119|   			free(buf);
#  120|   			fprintf(stderr, "realloc(%ld): out of memory\n", (long)(size + BUFSTEP));

Error: GCC_ANALYZER_WARNING (CWE-775):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c:125:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(list, 0)’
#  123|   		buf = new_buf;
#  124|   		size = new_size;
#  125|-> 		memset(buf + used, '\0', size - used);
#  126|   		n = read(fd, buf + used, size - used - 1);
#  127|   		if (n < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c: scope_hint: In function ‘containers_reexec’
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c:125:28: warning[-Wanalyzer-malloc-leak]: leak of ‘parse_proc_stringlist("/proc/self/cmdline")’
#  123|   		buf = new_buf;
#  124|   		size = new_size;
#  125|-> 		memset(buf + used, '\0', size - used);
#  126|   		n = read(fd, buf + used, size - used - 1);
#  127|   		if (n < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c:128:25: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
#  126|   		n = read(fd, buf + used, size - used - 1);
#  127|   		if (n < 0) {
#  128|-> 			fprintf(stderr, "read(): %m\n");
#  129|   			return NULL;
#  130|   		}

Error: GCC_ANALYZER_WARNING (CWE-401):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c: scope_hint: In function ‘parse_proc_stringlist’
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c:128:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’
#  126|   		n = read(fd, buf + used, size - used - 1);
#  127|   		if (n < 0) {
#  128|-> 			fprintf(stderr, "read(): %m\n");
#  129|   			return NULL;
#  130|   		}

Error: GCC_ANALYZER_WARNING (CWE-401):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c:154:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
#  152|   		}
#  153|   	}
#  154|-> 	ret[i] = NULL;
#  155|   	return ret;
#  156|   }

Error: GCC_ANALYZER_WARNING (CWE-401):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c:154:16: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’
#  152|   		}
#  153|   	}
#  154|-> 	ret[i] = NULL;
#  155|   	return ret;
#  156|   }

Error: GCC_ANALYZER_WARNING (CWE-401):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c: scope_hint: In function ‘containers_reexec’
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c:291:12: warning[-Wanalyzer-malloc-leak]: leak of ‘parse_proc_stringlist("/proc/self/cmdline")’
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/containers/storage/pkg/unshare/unshare.c:18: included_from: Included from here.
#  289|   		return fd;
#  290|   
#  291|-> 	if (fexecve(fd, argv, environ) == -1) {
#  292|   		close(fd);
#  293|   		fprintf(stderr, "Error during reexec(...): %m\n");

Error: COMPILER_WARNING (CWE-1164):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/mattn/go-sqlite3/sqlite3.go:85:1: warning[-Wunused-function]: ‘_sqlite3_exec’ defined but not used
#   85 | _sqlite3_exec(sqlite3* db, const char* pcmd, long long* rowid, long long* changes)
#      | ^~~~~~~~~~~~~
#   83|   
#   84|   static int
#   85|-> _sqlite3_exec(sqlite3* db, const char* pcmd, long long* rowid, long long* changes)
#   86|   {
#   87|     int rv = sqlite3_exec(db, pcmd, 0, 0, 0);

Error: GCC_ANALYZER_WARNING (CWE-476):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/miekg/pkcs11/pkcs11.go: scope_hint: In function 'New'
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/miekg/pkcs11/pkcs11.go:77:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'c'
#   75|   	CK_C_GetFunctionList list;
#   76|   	struct ctx *c = calloc(1, sizeof(struct ctx));
#   77|-> 	c->handle = dlopen(module, RTLD_LAZY);
#   78|   	if (c->handle == NULL) {
#   79|   		free(c);

Error: GCC_ANALYZER_WARNING (CWE-476):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/miekg/pkcs11/pkcs11.go: scope_hint: In function ‘New’
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/miekg/pkcs11/pkcs11.go:77:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘c’
#   75|   	CK_C_GetFunctionList list;
#   76|   	struct ctx *c = calloc(1, sizeof(struct ctx));
#   77|-> 	c->handle = dlopen(module, RTLD_LAZY);
#   78|   	if (c->handle == NULL) {
#   79|   		free(c);

Error: GCC_ANALYZER_WARNING (CWE-401):
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/miekg/pkcs11/pkcs11.go: scope_hint: In function ‘GetAttributeValue.part.0’
buildah-1.37.0-build/buildah-1.37.0/vendor/github.com/miekg/pkcs11/pkcs11.go:316:32: warning[-Wanalyzer-malloc-leak]: leak of ‘*((CK_ATTRIBUTE *)temp).pValue’
#  314|   			continue;
#  315|   		}
#  316|-> 		temp[i].pValue = calloc(temp[i].ulValueLen, sizeof(CK_BYTE));
#  317|   	}
#  318|   	return c->sym->C_GetAttributeValue(session, object, temp, templen);