Task #132211 - fixed.err

back to task #132211
download
Error: COMPILER_WARNING (CWE-704):
passt-386b5f5472b89769c025f5d5056348532a823b93/conf.c: scope_hint: In function ‘next_chunk’
passt-386b5f5472b89769c025f5d5056348532a823b93/conf.c:78:21: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#   78 |         char *sep = strchr(s, c);
#      |                     ^~~~~~
#   76|   static char *next_chunk(const char *s, char c)
#   77|   {
#   78|-> 	char *sep = strchr(s, c);
#   79|   	return sep ? sep + 1 : NULL;
#   80|   }

Error: COMPILER_WARNING (CWE-704):
passt-386b5f5472b89769c025f5d5056348532a823b93/conf.c: scope_hint: In function ‘conf_runas’
passt-386b5f5472b89769c025f5d5056348532a823b93/conf.c:1251:21: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 1251 |         char *sep = strchr(opt, ':');
#      |                     ^~~~~~
# 1249|   {
# 1250|   	const char *uopt, *gopt = NULL;
# 1251|-> 	char *sep = strchr(opt, ':');
# 1252|   	char *endptr;
# 1253|   

Error: GCC_ANALYZER_WARNING (CWE-775):
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:402:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(s, (int)fd)’
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:141:5: enter_function: entry to ‘main’
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:207:25: call_function: inlined call to ‘strncpy’ from ‘main’
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:210:32: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:211:33: branch_true: ...to here
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:323:21: branch_true: following ‘true’ branch (when ‘i != 100’)...
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:323:21: branch_true: ...to here
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:328:20: branch_false: following ‘false’ branch (when ‘s >= 0’)...
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:333:21: branch_false: ...to here
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:345:27: branch_false: following ‘false’ branch...
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:348:28: call_function: inlined call to ‘recv’ from ‘main’
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:348:27: branch_false: following ‘false’ branch...
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:389:12: branch_false: ...to here
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:389:12: branch_false: following ‘false’ branch (when ‘i != 100’)...
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:394:9: branch_false: ...to here
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:402:13: acquire_resource: opened here
passt-386b5f5472b89769c025f5d5056348532a823b93/qrap.c:402:12: danger: ‘dup2(s, (int)fd)’ leaks here; was opened at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
#  400|   	fprintf(stderr, "Connected to %s\n", addr.sun_path);
#  401|   
#  402|-> 	if (dup2(s, (int)fd) < 0) {
#  403|   		perror("dup");
#  404|   		exit(EXIT_FAILURE);