hyphen-2.8.8-24.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
hyphen-2.8.8-build/hyphen-2.8.8/example.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def2]
hyphen-2.8.8-build/hyphen-2.8.8/example.c:34:49: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>>' is a garbage value
#   32|       char r;
#   33|       for (i = 0; (i + 1) < strlen(word); i++) {
#   34|->         if (utf8 && ((((unsigned char) word[i]) >> 6) == 2)) continue;
#   35|           if ((hyphen[j] & 1)) {
#   36|               if (rep && rep[j]) {

Error: CLANG_WARNING: [#def3]
hyphen-2.8.8-build/hyphen-2.8.8/example.c:38:17: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#   36|               if (rep && rep[j]) {
#   37|                 k = hindex(word, j - pos[j] + 1, utf8) - word;
#   38|->               r = word[k];
#   39|                 word[k] = 0;
#   40|                 printf(" - %s%s", word, rep[j]);

Error: CLANG_WARNING: [#def4]
hyphen-2.8.8-build/hyphen-2.8.8/example.c:45:17: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#   43|               } else {
#   44|                 k = hindex(word, j + 1, utf8) - word;
#   45|->               r = word[k];
#   46|                 word[k] = 0;
#   47|                 printf(" - %s=", word);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
hyphen-2.8.8-build/hyphen-2.8.8/example.c: scope_hint: In function ‘main’
hyphen-2.8.8-build/hyphen-2.8.8/example.c:130:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*<unknown>, "r")’
#  128|       while(fgets(buf,BUFSIZE,wtclst) != NULL) {
#  129|          k = strlen(buf);
#  130|->        if (k && buf[k - 1] == '\n') buf[k - 1] = '\0';
#  131|          if (k >=2 && buf[k - 2] == '\r') buf[k-- - 2] = '\0';
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
hyphen-2.8.8-build/hyphen-2.8.8/example.c:130:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*<unknown>, "r")’
#  128|       while(fgets(buf,BUFSIZE,wtclst) != NULL) {
#  129|          k = strlen(buf);
#  130|->        if (k && buf[k - 1] == '\n') buf[k - 1] = '\0';
#  131|          if (k >=2 && buf[k - 2] == '\r') buf[k-- - 2] = '\0';
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
hyphen-2.8.8-build/hyphen-2.8.8/example.c:135:34: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*<unknown>, "r")’
#  133|          /* set aside some buffers to hold lower cased */
#  134|          /* and hyphen information */
#  135|->        lcword = (char *) malloc(k+1);
#  136|          hyphens = (char *)malloc(k+5);
#  137|          /* basic ascii lower-case, not suitable for real-world usage*/

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
hyphen-2.8.8-build/hyphen-2.8.8/example.c:135:34: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*<unknown>, "r")’
#  133|          /* set aside some buffers to hold lower cased */
#  134|          /* and hyphen information */
#  135|->        lcword = (char *) malloc(k+1);
#  136|          hyphens = (char *)malloc(k+5);
#  137|          /* basic ascii lower-case, not suitable for real-world usage*/

Error: GCC_ANALYZER_WARNING (CWE-476): [#def9]
hyphen-2.8.8-build/hyphen-2.8.8/example.c:139:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lcword’
#  137|          /* basic ascii lower-case, not suitable for real-world usage*/
#  138|          for (i = 0; i < k; ++i) {
#  139|->          lcword[i] = buf[i];
#  140|            if ( (lcword[i] >= 'A') && (lcword[i] <= 'Z') )
#  141|              lcword[i] += 32;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def10]
hyphen-2.8.8-build/hyphen-2.8.8/example.c:146:32: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
#  144|          /* first remove any trailing periods */
#  145|          n = k-1;
#  146|->        while((n >=0) && (lcword[n] == '.')) n--;
#  147|          n++;
#  148|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def11]
hyphen-2.8.8-build/hyphen-2.8.8/example.c:185:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘hyphword’
#  183|   	   }
#  184|            }
#  185|->          hyphword[j] = '\0';
#  186|            fprintf(stdout,"%s\n",hyphword);
#  187|            fflush(stdout);

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

Error: CLANG_WARNING: [#def13]
hyphen-2.8.8-build/hyphen-2.8.8/hyphen.c:334:53: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>>' is a garbage value
#  332|                   for (; pc < (strlen(word) + 1); pc++) {
#  333|                   /* beginning of an UTF-8 character (not '10' start bits) */
#  334|->                     if ((((unsigned char) word[pc]) >> 6) != 2) pu++;
#  335|                       if ((ps < 0) && (replindex == pu)) {
#  336|                           ps = replindex;

Error: CPPCHECK_WARNING: [#def14]
hyphen-2.8.8-build/hyphen-2.8.8/substrings.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def15]
hyphen-2.8.8-build/hyphen-2.8.8/substrings.c:112:16: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value
#  110|     int i,j;

#  111|     for (i=0,j=0; i<l; i++) {

#  112|->     if (expr[i]!='0') expr[j++] = expr[i];

#  113|     }

#  114|     expr[j]=0;


Error: CLANG_WARNING: [#def16]
hyphen-2.8.8-build/hyphen-2.8.8/substrings.c:159:19: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>' is a garbage value
#  157|     // hyphenation encoders

#  158|     for (j=0; j<l2; j++) {

#  159|->     if (subexpr[j]>expr[off+j]) {

#  160|         expr[off+j] = subexpr[j];

#  161|       }


Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
hyphen-2.8.8-build/hyphen-2.8.8/substrings.c: scope_hint: In function ‘main’
hyphen-2.8.8-build/hyphen-2.8.8/substrings.c:179:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "r")’
#  177|     if (argc!=3) die("Usage: <orig-file> <new-file>\n");

#  178|     if ((in = fopen(argv[1],"r"))==NULL) die("Could not read input");

#  179|->   if ((out = fopen(argv[2],"w"))==NULL) die("Could not create output");

#  180|     // read all patterns and split in pure text (_key) & expanded patterns (_val)

#  181|     while(fgets(format,132,in) != NULL) {


Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
hyphen-2.8.8-build/hyphen-2.8.8/substrings.c:179:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "r")’
#  177|     if (argc!=3) die("Usage: <orig-file> <new-file>\n");

#  178|     if ((in = fopen(argv[1],"r"))==NULL) die("Could not read input");

#  179|->   if ((out = fopen(argv[2],"w"))==NULL) die("Could not create output");

#  180|     // read all patterns and split in pure text (_key) & expanded patterns (_val)

#  181|     while(fgets(format,132,in) != NULL) {


Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
hyphen-2.8.8-build/hyphen-2.8.8/substrings.c:184:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[2], "w")’
#  182|       int l = strlen(format);

#  183|       if (format[l-1]=='\n') { l--; format[l]=0; } // Chomp

#  184|->     if (format[0]=='%' || format[0]==0) {

#  185|         // skip

#  186|       } else {


Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
hyphen-2.8.8-build/hyphen-2.8.8/substrings.c:184:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[2], "w")’
#  182|       int l = strlen(format);

#  183|       if (format[l-1]=='\n') { l--; format[l]=0; } // Chomp

#  184|->     if (format[0]=='%' || format[0]==0) {

#  185|         // skip

#  186|       } else {


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-32.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namehyphen-2.8.8-24.fc41
store-results-to/tmp/tmp7yy90c_k/hyphen-2.8.8-24.fc41.tar.xz
time-created2024-07-03 13:25:39
time-finished2024-07-03 13:26:35
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp7yy90c_k/hyphen-2.8.8-24.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp7yy90c_k/hyphen-2.8.8-24.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9