libksba-1.6.6-1.fc41

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-126): [#def1]
libksba-1.6.6/src/asn1-func.c: scope_hint: In function ‘_ksba_asn_set_value’
libksba-1.6.6/src/asn1-func.c:147:30: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libksba-1.6.6/src/asn1-func.c:44: included_from: Included from here.
libksba-1.6.6/src/asn1-func.c:186:3: note: in expansion of macro ‘return_if_fail’
libksba-1.6.6/src/asn1-func.c:130:3: note: in expansion of macro ‘return_if_fail’
libksba-1.6.6/src/asn1-func.c:146:7: note: in expansion of macro ‘return_if_fail’
libksba-1.6.6/src/asn1-func.c:147:30: note: read of 3 bytes from after the end of ‘helpbuf’
libksba-1.6.6/src/asn1-func.c:147:30: note: valid subscripts for ‘helpbuf’ are ‘[0]’ to ‘[0]’
#  └──────────────────────────────────────────────────────────────────────┘
#                 ^                                     ^
#  145|       case VALTYPE_BOOL:
#  146|         return_if_fail (len && value);
#  147|->       node->value.v_bool = !!*(const unsigned *)value;
#  148|         break;
#  149|       case VALTYPE_CSTR:

Error: CLANG_WARNING: [#def2]
libksba-1.6.6/src/asn1-func.c:1061:15: warning[core.NullDereference]: Access to field 'down' results in a dereference of a null pointer (loaded from variable 'd')
# 1059|   	    }
# 1060|   
# 1061|->           if (d->down && tmp)
# 1062|               { /* Need to merge it with the existing down */
# 1063|                 AsnNode x;

Error: CLANG_WARNING: [#def3]
libksba-1.6.6/src/asn1-func.c:1177:34: warning[core.NullDereference]: Dereference of null pointer
# 1175|   
# 1176|                 if (x->type == TYPE_TAG)
# 1177|->                 d->flags.has_tag =1;
# 1178|                 else if (x->type == TYPE_DEFAULT)
# 1179|                   d->flags.has_default =1;

Error: CLANG_WARNING: [#def4]
libksba-1.6.6/src/asn1-func.c:1179:38: warning[core.NullDereference]: Dereference of null pointer
# 1177|                   d->flags.has_tag =1;
# 1178|                 else if (x->type == TYPE_DEFAULT)
# 1179|->                 d->flags.has_default =1;
# 1180|               }
# 1181|             d->down = tmp;

Error: CLANG_WARNING: [#def5]
libksba-1.6.6/src/asn1-func.c:1181:19: warning[core.NullDereference]: Access to field 'down' results in a dereference of a null pointer (loaded from variable 'd')
# 1179|                   d->flags.has_default =1;
# 1180|               }
# 1181|->           d->down = tmp;
# 1182|           }
# 1183|         else

Error: CLANG_WARNING: [#def6]
libksba-1.6.6/src/asn1-func.c:1218:15: warning[core.NullDereference]: Access to field 'down' results in a dereference of a null pointer (loaded from variable 'd')
# 1216|   		}
# 1217|   	    }
# 1218|->           if (d->down && tmp)
# 1219|               { /* Need to merge it with the existing down */
# 1220|                 AsnNode x;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def7]
libksba-1.6.6/src/asn1-parse.c: scope_hint: In function '_ksba_asn1_yyparse'
libksba-1.6.6/src/asn1-parse.c:669:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'yyss'
libksba-1.6.6/src/asn1-parse.c:654:9: note: in expansion of macro 'YYCOPY'
libksba-1.6.6/src/asn1-parse.c:1613:9: note: in expansion of macro 'YYSTACK_RELOCATE'
libksba-1.6.6/src/asn1-parse.c:654:9: note: in expansion of macro 'YYCOPY'
libksba-1.6.6/src/asn1-parse.c:1613:9: note: in expansion of macro 'YYSTACK_RELOCATE'
libksba-1.6.6/src/asn1-parse.c:654:9: note: in expansion of macro 'YYCOPY'
libksba-1.6.6/src/asn1-parse.c:1613:9: note: in expansion of macro 'YYSTACK_RELOCATE'
#  667|   #  if defined __GNUC__ && 1 < __GNUC__
#  668|   #   define YYCOPY(Dst, Src, Count) \
#  669|->       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
#  670|   #  else
#  671|   #   define YYCOPY(Dst, Src, Count)              \

Error: GCC_ANALYZER_WARNING (CWE-457): [#def8]
libksba-1.6.6/src/asn1-parse.c: scope_hint: In function ‘_ksba_asn1_yyparse’
libksba-1.6.6/src/asn1-parse.c:669:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
libksba-1.6.6/src/asn1-parse.c:654:9: note: in expansion of macro ‘YYCOPY’
libksba-1.6.6/src/asn1-parse.c:1613:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
libksba-1.6.6/src/asn1-parse.c:654:9: note: in expansion of macro ‘YYCOPY’
libksba-1.6.6/src/asn1-parse.c:1613:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
libksba-1.6.6/src/asn1-parse.c:654:9: note: in expansion of macro ‘YYCOPY’
libksba-1.6.6/src/asn1-parse.c:1613:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
#  667|   #  if defined __GNUC__ && 1 < __GNUC__
#  668|   #   define YYCOPY(Dst, Src, Count) \
#  669|->       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
#  670|   #  else
#  671|   #   define YYCOPY(Dst, Src, Count)              \

Error: GCC_ANALYZER_WARNING (CWE-457): [#def9]
libksba-1.6.6/src/asn1-parse.c:1740:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*<unknown>'
# 1738|        unconditionally makes the parser a bit smaller, and it avoids a
# 1739|        GCC warning that YYVAL may be used uninitialized.  */
# 1740|->   yyval = yyvsp[1-yylen];
# 1741|   
# 1742|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def10]
libksba-1.6.6/src/asn1-parse.c:1740:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
# 1738|        unconditionally makes the parser a bit smaller, and it avoids a
# 1739|        GCC warning that YYVAL may be used uninitialized.  */
# 1740|->   yyval = yyvsp[1-yylen];
# 1741|   
# 1742|   

Error: CLANG_WARNING: [#def11]
libksba-1.6.6/src/cert.c:1091:17: warning[deadcode.DeadStores]: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
# 1089|   
# 1090|     /* check that there is only one */
# 1091|->   for (idx++; !(err=ksba_cert_get_extension (cert, idx, &oid, NULL,
# 1092|                                                NULL, NULL)); idx++)
# 1093|       {

Error: CLANG_WARNING: [#def12]
libksba-1.6.6/src/cert.c:1198:17: warning[deadcode.DeadStores]: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
# 1196|   
# 1197|     /* check that there is only one */
# 1198|->   for (idx++; !(err=ksba_cert_get_extension (cert, idx, &oid, NULL,
# 1199|                                                NULL, NULL)); idx++)
# 1200|       {

Error: CLANG_WARNING: [#def13]
libksba-1.6.6/src/cert.c:1263:5: warning[deadcode.DeadStores]: Value stored to 'mask' is never read
# 1261|     else {
# 1262|       bits &= mask;
# 1263|->     mask = ~0;
# 1264|     }
# 1265|     if (bits & 0x80)

Error: CLANG_WARNING: [#def14]
libksba-1.6.6/src/cert.c:1637:13: warning[deadcode.DeadStores]: Value stored to 'mask' is never read
# 1635|             else {
# 1636|               bits &= ~mask;
# 1637|->             mask = 0;
# 1638|             }
# 1639|   

Error: CLANG_WARNING: [#def15]
libksba-1.6.6/src/cert.c:1845:17: warning[deadcode.DeadStores]: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
# 1843|   
# 1844|     /* check that there is only one */
# 1845|->   for (idx++; !(err=ksba_cert_get_extension (cert, idx, &oid, NULL,
# 1846|                                                NULL, NULL)); idx++)
# 1847|       {

Error: CLANG_WARNING: [#def16]
libksba-1.6.6/src/cert.c:1989:17: warning[deadcode.DeadStores]: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
# 1987|   
# 1988|     /* Check that there is only one */
# 1989|->   for (idx++; !(err=ksba_cert_get_extension (cert, idx, &tmpoid, NULL,
# 1990|                                                NULL, NULL)); idx++)
# 1991|       {

Error: CLANG_WARNING: [#def17]
libksba-1.6.6/src/certreq.c:493:9: warning[deadcode.DeadStores]: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
#  491|     s++;
#  492|   
#  493|->   if (!(n = snext (&s)))
#  494|       return gpg_error (GPG_ERR_INV_SEXP);
#  495|     if (!smatch (&s, 7, "sig-val"))

Error: CLANG_WARNING: [#def18]
libksba-1.6.6/src/certreq.c:670:9: warning[deadcode.DeadStores]: Value stored to 'err' is never read
#  668|         err = _ksba_ber_write_tl (w, TYPE_OBJECT_ID, CLASS_UNIVERSAL, 0, n);
#  669|         if (!err)
#  670|->         err = ksba_writer_write (w, p, n);
#  671|         xfree (p);
#  672|   

Error: CLANG_WARNING: [#def19]
libksba-1.6.6/src/certreq.c:746:9: warning[deadcode.DeadStores]: Value stored to 'err' is never read
#  744|         err = _ksba_ber_write_tl (writer, TYPE_SET, CLASS_UNIVERSAL, 1, valuelen);
#  745|         if (!err)
#  746|->         err = ksba_writer_write (writer, value, valuelen);
#  747|   
#  748|         /* Put this all into a SEQUENCE */

Error: CLANG_WARNING: [#def20]
libksba-1.6.6/src/cms-parser.c:773:11: warning[deadcode.DeadStores]: Value stored to 'err' is never read
#  771|           {
#  772|   	  xfree (si);
#  773|->           err = 0;
#  774|             break;
#  775|           }

Error: CLANG_WARNING: [#def21]
libksba-1.6.6/src/cms.c:2032:9: warning[deadcode.DeadStores]: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
# 2030|       return gpg_error (GPG_ERR_INV_INDEX);
# 2031|   
# 2032|->   if (!(n = snext (&s)))
# 2033|       return gpg_error (GPG_ERR_INV_SEXP);
# 2034|     if (!smatch (&s, 7, "sig-val"))

Error: CLANG_WARNING: [#def22]
libksba-1.6.6/src/der-builder.c:305:5: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
#  303|       p[0] = 0;
#  304|     if (valuelen)
#  305|->     memcpy (p+need_extra, value, valuelen);
#  306|     add_val_core (d, 0, TYPE_INTEGER, p, need_extra+valuelen, 0);
#  307|   }

Error: CLANG_WARNING: [#def23]
libksba-1.6.6/src/der-encoder.c:523:7: warning[core.NullDereference]: Access to field 'type' results in a dereference of a null pointer (loaded from variable 'root')
#  521|     unsigned long len = 0;
#  522|   
#  523|->   if (root->type == TYPE_NULL)
#  524|       return root->nhdr;
#  525|   

Error: CLANG_WARNING: [#def24]
libksba-1.6.6/src/dn.c:1020:7: warning[deadcode.DeadStores]: Value stored to 'err' is never read
# 1018|         n  = _ksba_ber_count_tl (TYPE_SET, CLASS_UNIVERSAL, 1, n);
# 1019|         n += n1;
# 1020|->       err = _ksba_ber_write_tl (writer, TYPE_SET, CLASS_UNIVERSAL, 1, n);
# 1021|   
# 1022|         /* The sequence tag */

Error: CLANG_WARNING: [#def25]
libksba-1.6.6/src/dn.c:1024:7: warning[deadcode.DeadStores]: Value stored to 'err' is never read
# 1022|         /* The sequence tag */
# 1023|         n = n1;
# 1024|->       err = _ksba_ber_write_tl (writer, TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, n);
# 1025|   
# 1026|         /* the OBJECT ID */

Error: CLANG_WARNING: [#def26]
libksba-1.6.6/src/keyinfo.c:1023:13: warning[deadcode.DeadStores]: Value stored to 'got_curve' is never read
# 1021|               put_stringbuf_sexp (&sb, ecdomainparm_to_name[i].name);
# 1022|               put_stringbuf (&sb, ")");
# 1023|->             got_curve = 1;
# 1024|               break;
# 1025|             }

Error: CLANG_WARNING: [#def27]
libksba-1.6.6/src/name.c:90:5: warning[core.NullDereference]: Array access (via field 'names') results in a null pointer dereference
#   88|   
#   89|     for (i=0; i < name->n_names; i++)
#   90|->     xfree (name->names[i]);
#   91|     xfree (name->names);
#   92|     name->n_names = 0;

Error: CLANG_WARNING: [#def28]
libksba-1.6.6/src/ocsp.c:116:34: warning[deadcode.DeadStores]: Value stored to 'ri' is never read
#  114|     xfree (ocsp->digest_oid);
#  115|     xfree (ocsp->request_buffer);
#  116|->   for (; (ri=ocsp->requestlist); ri = ocsp->requestlist )
#  117|       {
#  118|         ocsp->requestlist = ri->next;

Error: CLANG_WARNING: [#def29]
libksba-1.6.6/src/ocsp.c:298:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read
#  296|                                 ocsp->noncelen);
#  297|     if (!err)
#  298|->     err = ksba_writer_write (w1, ocsp->nonce, ocsp->noncelen);
#  299|   
#  300|     /* Put a sequence around. */

Error: CLANG_WARNING: [#def30]
libksba-1.6.6/src/ocsp.c:309:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read
#  307|     err = _ksba_ber_write_tl (w2, TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, derlen);
#  308|     if (!err)
#  309|->     err = ksba_writer_write (w2, p, derlen);
#  310|     xfree (p); p = NULL;
#  311|   

Error: CLANG_WARNING: [#def31]
libksba-1.6.6/src/ocsp.c:324:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read
#  322|     err = _ksba_ber_write_tl (w1, TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, derlen);
#  323|     if (!err)
#  324|->     err = ksba_writer_write (w1, p, derlen);
#  325|     xfree (p); p = NULL;
#  326|   

Error: CLANG_WARNING: [#def32]
libksba-1.6.6/src/ocsp.c:505:3: warning[deadcode.DeadStores]: Value stored to 'err' is never read
#  503|   
#  504|     /* The requestExtensions go here. */
#  505|->   err = write_request_extensions (ocsp, w4);
#  506|   
#  507|     /* Write the tbsRequest. */

Error: CLANG_WARNING: [#def33]
libksba-1.6.6/src/ocsp.c:1119:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read
# 1117|       }
# 1118|     else
# 1119|->     err = gpg_error (GPG_ERR_INV_OBJ);
# 1120|   
# 1121|     /* thisUpdate. */

Error: CLANG_WARNING: [#def34]
libksba-1.6.6/src/ocsp.c:1151:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read
# 1149|       }
# 1150|     else
# 1151|->     err = gpg_error (GPG_ERR_INV_OBJ);
# 1152|   
# 1153|     /* singleExtensions is optional */

Error: CLANG_WARNING: [#def35]
libksba-1.6.6/src/ocsp.c:1172:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read
# 1170|       }
# 1171|     else
# 1172|->     err = gpg_error (GPG_ERR_INV_OBJ);
# 1173|   
# 1174|     return 0;

Error: CLANG_WARNING: [#def36]
libksba-1.6.6/src/ocsp.c:1252:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read
# 1250|       }
# 1251|     else
# 1252|->     err = gpg_error (GPG_ERR_INV_OBJ);
# 1253|   
# 1254|     /* The producedAt field. */

Error: CLANG_WARNING: [#def37]
libksba-1.6.6/src/ocsp.c:1356:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read
# 1354|     if (!(ti.class == CLASS_UNIVERSAL && ti.tag == TYPE_BIT_STRING
# 1355|           && !ti.is_constructed) )
# 1356|->     err = gpg_error (GPG_ERR_INV_OBJ);
# 1357|     else if (!ti.length)
# 1358|       err = gpg_error (GPG_ERR_TOO_SHORT);

Error: CLANG_WARNING: [#def38]
libksba-1.6.6/src/ocsp.c:1358:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read
# 1356|       err = gpg_error (GPG_ERR_INV_OBJ);
# 1357|     else if (!ti.length)
# 1358|->     err = gpg_error (GPG_ERR_TOO_SHORT);
# 1359|     else if (ti.length > msglen)
# 1360|       err = gpg_error (GPG_ERR_BAD_BER);

Error: CLANG_WARNING: [#def39]
libksba-1.6.6/src/ocsp.c:1360:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read
# 1358|       err = gpg_error (GPG_ERR_TOO_SHORT);
# 1359|     else if (ti.length > msglen)
# 1360|->     err = gpg_error (GPG_ERR_BAD_BER);
# 1361|     parse_skip (&msg, &msglen, &ti);
# 1362|     len = len - msglen;

Error: CLANG_WARNING: [#def40]
libksba-1.6.6/src/ocsp.c:1392:9: warning[deadcode.DeadStores]: Value stored to 's' is never read
# 1390|         {
# 1391|           /* Find the length of the certificate. */
# 1392|->         s = msg;
# 1393|           err = parse_sequence (&msg, &msglen, &ti);
# 1394|           if (err)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def41]
libksba-1.6.6/tests/cert-basic.c: scope_hint: In function ‘one_file’
libksba-1.6.6/tests/cert-basic.c:454:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "rb")’
#  452|   
#  453|     err = ksba_reader_new (&r);
#  454|->   if (err)
#  455|       fail_if_err (err);
#  456|     err = ksba_reader_set_file (r, fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
libksba-1.6.6/tests/cert-basic.c:454:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "rb")’
#  452|   
#  453|     err = ksba_reader_new (&r);
#  454|->   if (err)
#  455|       fail_if_err (err);
#  456|     err = ksba_reader_set_file (r, fp);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def43]
libksba-1.6.6/tests/sha1.c: scope_hint: In function ‘transform’
libksba-1.6.6/tests/sha1.c:126:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘x[1]’
libksba-1.6.6/tests/sha1.c:122:41: note: in definition of macro ‘R’
libksba-1.6.6/tests/sha1.c:119:39: note: in expansion of macro ‘rol’
libksba-1.6.6/tests/sha1.c:125:3: note: in expansion of macro ‘R’
libksba-1.6.6/tests/sha1.c:122:41: note: in definition of macro ‘R’
#  124|   			       } while(0)
#  125|     R( a, b, c, d, e, F1, K1, x[ 0] );
#  126|->   R( e, a, b, c, d, F1, K1, x[ 1] );
#  127|     R( d, e, a, b, c, F1, K1, x[ 2] );
#  128|     R( c, d, e, a, b, F1, K1, x[ 3] );

Error: GCC_ANALYZER_WARNING (CWE-775): [#def44]
libksba-1.6.6/tests/t-cms-parser.c: scope_hint: In function ‘one_file’
libksba-1.6.6/tests/t-cms-parser.c:84:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "rb")’
#   82|   
#   83|     err = ksba_reader_new (&r);
#   84|->   if (err)
#   85|       fail_if_err (err);
#   86|     err = ksba_reader_set_file (r, fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
libksba-1.6.6/tests/t-cms-parser.c:84:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "rb")’
#   82|   
#   83|     err = ksba_reader_new (&r);
#   84|->   if (err)
#   85|       fail_if_err (err);
#   86|     err = ksba_reader_set_file (r, fp);

Error: CLANG_WARNING: [#def46]
libksba-1.6.6/tests/t-cms-parser.c:174:15: warning[deadcode.DeadStores]: Value stored to 'err' is never read
#  172|                 printf ("recipient %d"
#  173|                         " - kekri or pwri detected\n", idx);
#  174|->               err = 0;
#  175|               }
#  176|             else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
libksba-1.6.6/tests/t-crl-parser.c: scope_hint: In function ‘one_file’
libksba-1.6.6/tests/t-crl-parser.c:134:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "rb")’
#  132|   
#  133|     err = ksba_reader_new (&r);
#  134|->   if (err)
#  135|       fail_if_err (err);
#  136|     err = ksba_reader_set_file (r, fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
libksba-1.6.6/tests/t-crl-parser.c:134:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "rb")’
#  132|   
#  133|     err = ksba_reader_new (&r);
#  134|->   if (err)
#  135|       fail_if_err (err);
#  136|     err = ksba_reader_set_file (r, fp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
libksba-1.6.6/tests/t-ocsp.c: scope_hint: In function ‘get_one_cert’
libksba-1.6.6/tests/t-ocsp.c:111:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
#  109|   
#  110|     err = ksba_reader_new (&r);
#  111|->   if (err)
#  112|       fail_if_err (err);
#  113|     err = ksba_reader_set_file (r, fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
libksba-1.6.6/tests/t-ocsp.c:111:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
#  109|   
#  110|     err = ksba_reader_new (&r);
#  111|->   if (err)
#  112|       fail_if_err (err);
#  113|     err = ksba_reader_set_file (r, fp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
libksba-1.6.6/tests/t-ocsp.c: scope_hint: In function ‘one_request’
libksba-1.6.6/tests/t-ocsp.c:160:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("a.req", "wb")’
libksba-1.6.6/tests/t-ocsp.c:32: included_from: Included from here.
libksba-1.6.6/tests/t-ocsp.c:114:3: note: in expansion of macro ‘fail_if_err’
libksba-1.6.6/tests/t-ocsp.c:121:3: note: in expansion of macro ‘fail_if_err2’
libksba-1.6.6/tests/t-ocsp.c:114:3: note: in expansion of macro ‘fail_if_err’
libksba-1.6.6/tests/t-ocsp.c:121:3: note: in expansion of macro ‘fail_if_err2’
libksba-1.6.6/tests/t-ocsp.c:140:3: note: in expansion of macro ‘fail_if_err’
libksba-1.6.6/tests/t-ocsp.c:143:3: note: in expansion of macro ‘fail_if_err’
libksba-1.6.6/tests/t-ocsp.c:151:3: note: in expansion of macro ‘fail_if_err’
#  158|       if (!fp)
#  159|         fail ("can't create output file `a.req'");
#  160|->     if (fwrite (request, requestlen, 1, fp) != 1)
#  161|         fail ("can't write output");
#  162|       fclose (fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
libksba-1.6.6/tests/t-ocsp.c:160:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("a.req", "wb")’
libksba-1.6.6/tests/t-ocsp.c:114:3: note: in expansion of macro ‘fail_if_err’
libksba-1.6.6/tests/t-ocsp.c:121:3: note: in expansion of macro ‘fail_if_err2’
libksba-1.6.6/tests/t-ocsp.c:114:3: note: in expansion of macro ‘fail_if_err’
libksba-1.6.6/tests/t-ocsp.c:121:3: note: in expansion of macro ‘fail_if_err2’
libksba-1.6.6/tests/t-ocsp.c:140:3: note: in expansion of macro ‘fail_if_err’
libksba-1.6.6/tests/t-ocsp.c:143:3: note: in expansion of macro ‘fail_if_err’
libksba-1.6.6/tests/t-ocsp.c:151:3: note: in expansion of macro ‘fail_if_err’
#  158|       if (!fp)
#  159|         fail ("can't create output file `a.req'");
#  160|->     if (fwrite (request, requestlen, 1, fp) != 1)
#  161|         fail ("can't write output");
#  162|       fclose (fp);

Error: CLANG_WARNING: [#def53]
libksba-1.6.6/tests/t-ocsp.c:391:5: warning[deadcode.DeadStores]: Value stored to 'srcdir' is never read
#  389|   
#  390|     if (!srcdir)
#  391|->     srcdir = ".";
#  392|   
#  393|     ksba_set_hash_buffer_function (my_hash_buffer, NULL);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def54]
libksba-1.6.6/tests/t-reader.c: scope_hint: In function ‘test_fd’
libksba-1.6.6/tests/t-reader.c:50:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 0)’
#   48|       }
#   49|   
#   50|->   if ((err = ksba_reader_new (&reader)))
#   51|       {
#   52|         fprintf (stderr, "ksba_reader_new() failed: %s\n", gpg_strerror (err));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
libksba-1.6.6/tests/t-reader.c: scope_hint: In function ‘test_file’
libksba-1.6.6/tests/t-reader.c:93:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
#   91|       }
#   92|   
#   93|->   if ((err = ksba_reader_new (&reader)))
#   94|       {
#   95|         fprintf (stderr, "ksba_reader_new() failed: %s\n", gpg_strerror (err));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
libksba-1.6.6/tests/t-reader.c:93:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "r")’
#   91|       }
#   92|   
#   93|->   if ((err = ksba_reader_new (&reader)))
#   94|       {
#   95|         fprintf (stderr, "ksba_reader_new() failed: %s\n", gpg_strerror (err));

Error: CLANG_WARNING: [#def57]
libksba-1.6.6/tests/t-reader.c:158:8: warning[deadcode.DeadStores]: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
#  156|       }
#  157|   
#  158|->   if ((err = ksba_reader_new (&reader)))
#  159|       {
#  160|         exit (1);

Scan Properties

analyzer-version-clang18.1.3
analyzer-version-cppcheck2.13.0
analyzer-version-gcc14.0.1
analyzer-version-gcc-analyzer14.0.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-190.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibksba-1.6.6-1.fc41
store-results-to/tmp/tmpwguxqu37/libksba-1.6.6-1.fc41.tar.xz
time-created2024-04-22 10:57:23
time-finished2024-04-22 10:58:59
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpwguxqu37/libksba-1.6.6-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpwguxqu37/libksba-1.6.6-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9