units-2.22-6.fc39 - Defects in Patches

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1]
units-2.22/parse.tab.c: scope_hint: In function ‘unitsparse’
units-2.22/parse.tab.c:600:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
units-2.22/parse.tab.c:585:9: note: in expansion of macro ‘YYCOPY’
units-2.22/parse.tab.c:1445:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
units-2.22/parse.y:534:7: note: in expansion of macro ‘yyparse’
units-2.22/parse.tab.c:1312:1: note: in expansion of macro ‘yyparse’
units-2.22/parse.tab.c:585:9: note: in expansion of macro ‘YYCOPY’
units-2.22/parse.tab.c:1445:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
units-2.22/parse.tab.c:585:9: note: in expansion of macro ‘YYCOPY’
units-2.22/parse.tab.c:1445:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
#  598|   #  if defined __GNUC__ && 1 < __GNUC__
#  599|   #   define YYCOPY(Dst, Src, Count) \
#  600|->       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
#  601|   #  else
#  602|   #   define YYCOPY(Dst, Src, Count)              \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
units-2.22/units.c: scope_hint: In function ‘growbuffer’
units-2.22/units.c:386:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
#  384|     *bufsize += BUFGROW;
#  385|     if (usemalloc)
#  386|->     *buf = malloc(*bufsize);
#  387|     else
#  388|       *buf = realloc(*buf,*bufsize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
units-2.22/units.c:388:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
#  386|       *buf = malloc(*bufsize);
#  387|     else
#  388|->     *buf = realloc(*buf,*bufsize);
#  389|     if (!*buf){
#  390|       fprintf(stderr, "%s: memory allocation error (growbuffer)\n",progname);  

Error: GCC_ANALYZER_WARNING (CWE-457): [#def4]
units-2.22/units.c: scope_hint: In function ‘showfunction’
units-2.22/units.c:2847:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘not_dimensionless’
# 2845|       if (func->domain_min && func->domain_max) {
# 2846|         logprintf(num_format.format, *func->domain_min);
# 2847|->       if (func->dimen && (not_dimensionless || unit.factor != 1)){
# 2848|           if (isdecimal(*func->dimen))
# 2849|             logputs(" *");

Error: GCC_ANALYZER_WARNING (CWE-457): [#def5]
units-2.22/units.c:2872:8: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘not_dimensionless’
# 2870|       logputchar('\n');
# 2871|       for(i=strwidth(deftext);i;i--) logputchar(' ');
# 2872|->     if (not_dimensionless) 
# 2873|         logprintf("%s has units %s",func->param, func->dimen);
# 2874|       else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
units-2.22/units.c: scope_hint: In function ‘getprogdir’
units-2.22/units.c:4296:10: warning[-Wanalyzer-malloc-leak]: leak of ‘progdir’
# 4294|     *p = '\0';  
# 4295|    
# 4296|->   return progdir; 
# 4297|   }
# 4298|   

Scan Properties

analyzer-version-clang17.0.6
analyzer-version-cppcheck2.13.0
analyzer-version-gcc13.2.1
analyzer-version-gcc-analyzer13.2.1
analyzer-version-shellcheck0.9.0
diffbase-analyzer-version-clang17.0.6
diffbase-analyzer-version-cppcheck2.13.0
diffbase-analyzer-version-gcc13.2.1
diffbase-analyzer-version-gcc-analyzer13.2.1
diffbase-analyzer-version-shellcheck0.9.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-5.us-west-2.compute.internal
diffbase-mock-configfedora-39-x86_64
diffbase-project-nameunits-2.22-6.fc39
diffbase-store-results-to/tmp/csmock0sonfq2w/units-2.22-6.fc39/run0
diffbase-time-created2024-04-16 12:29:18
diffbase-time-finished2024-04-16 12:32:26
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-39-x86_64' '-t' 'clang,shellcheck,cppcheck,gcc' '-o' '/tmp/tmpv8jpk8xg/units-2.22-6.fc39.tar.xz' '--gcc-analyze' '--diff-patches' '/tmp/tmpv8jpk8xg/units-2.22-6.fc39.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-5.us-west-2.compute.internal
mock-configfedora-39-x86_64
project-nameunits-2.22-6.fc39
store-results-to/tmp/tmpv8jpk8xg/units-2.22-6.fc39.tar.xz
time-created2024-04-16 12:29:18
time-finished2024-04-16 12:33:52
titleunits-2.22-6.fc39 - Defects in Patches
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-39-x86_64' '-t' 'clang,shellcheck,cppcheck,gcc' '-o' '/tmp/tmpv8jpk8xg/units-2.22-6.fc39.tar.xz' '--gcc-analyze' '--diff-patches' '/tmp/tmpv8jpk8xg/units-2.22-6.fc39.src.rpm'
tool-versioncsmock-3.5.3-1.el9