crypto/ts/ts_rsp_verify.c:452: error: NULL_DEREFERENCE
  pointer `signer` last assigned on line 414 could be null and is dereferenced by call to `ts_check_signer_name()` at line 452, column 25.
Showing all 34 steps of the trace


crypto/ts/ts_rsp_verify.c:411:1: start of procedure int_ts_RESP_verify_token()
409.    *      - Check if the TSA name is the expected TSA.
410.    */
411. > static int int_ts_RESP_verify_token(TS_VERIFY_CTX *ctx,
412.                                       PKCS7 *token, TS_TST_INFO *tst_info)
413.   {

crypto/ts/ts_rsp_verify.c:414:5: 
412.                                       PKCS7 *token, TS_TST_INFO *tst_info)
413.   {
414. >     X509 *signer = NULL;
415.       GENERAL_NAME *tsa_name = tst_info->tsa;
416.       X509_ALGOR *md_alg = NULL;

crypto/ts/ts_rsp_verify.c:415:5: 
413.   {
414.       X509 *signer = NULL;
415. >     GENERAL_NAME *tsa_name = tst_info->tsa;
416.       X509_ALGOR *md_alg = NULL;
417.       unsigned char *imprint = NULL;

crypto/ts/ts_rsp_verify.c:416:5: 
414.       X509 *signer = NULL;
415.       GENERAL_NAME *tsa_name = tst_info->tsa;
416. >     X509_ALGOR *md_alg = NULL;
417.       unsigned char *imprint = NULL;
418.       unsigned imprint_len = 0;

crypto/ts/ts_rsp_verify.c:417:5: 
415.       GENERAL_NAME *tsa_name = tst_info->tsa;
416.       X509_ALGOR *md_alg = NULL;
417. >     unsigned char *imprint = NULL;
418.       unsigned imprint_len = 0;
419.       int ret = 0;

crypto/ts/ts_rsp_verify.c:418:5: 
416.       X509_ALGOR *md_alg = NULL;
417.       unsigned char *imprint = NULL;
418. >     unsigned imprint_len = 0;
419.       int ret = 0;
420.       int flags = ctx->flags;

crypto/ts/ts_rsp_verify.c:419:5: 
417.       unsigned char *imprint = NULL;
418.       unsigned imprint_len = 0;
419. >     int ret = 0;
420.       int flags = ctx->flags;
421.   

crypto/ts/ts_rsp_verify.c:420:5: 
418.       unsigned imprint_len = 0;
419.       int ret = 0;
420. >     int flags = ctx->flags;
421.   
422.       /* Some options require us to also check the signature */

crypto/ts/ts_rsp_verify.c:423:11: Taking true branch
421.   
422.       /* Some options require us to also check the signature */
423.       if (((flags & TS_VFY_SIGNER) && tsa_name != NULL)
                 ^
424.               || (flags & TS_VFY_TSA_NAME)) {
425.           flags |= TS_VFY_SIGNATURE;

crypto/ts/ts_rsp_verify.c:423:37: Taking true branch
421.   
422.       /* Some options require us to also check the signature */
423.       if (((flags & TS_VFY_SIGNER) && tsa_name != NULL)
                                           ^
424.               || (flags & TS_VFY_TSA_NAME)) {
425.           flags |= TS_VFY_SIGNATURE;

crypto/ts/ts_rsp_verify.c:425:9: 
423.       if (((flags & TS_VFY_SIGNER) && tsa_name != NULL)
424.               || (flags & TS_VFY_TSA_NAME)) {
425. >         flags |= TS_VFY_SIGNATURE;
426.       }
427.   

crypto/ts/ts_rsp_verify.c:428:10: Taking false branch
426.       }
427.   
428.       if ((flags & TS_VFY_SIGNATURE)
                ^
429.           && !TS_RESP_verify_signature(token, ctx->certs, ctx->store, &signer))
430.           goto err;

crypto/ts/ts_rsp_verify.c:431:10: Taking false branch
429.           && !TS_RESP_verify_signature(token, ctx->certs, ctx->store, &signer))
430.           goto err;
431.       if ((flags & TS_VFY_VERSION)
                ^
432.           && TS_TST_INFO_get_version(tst_info) != 1) {
433.           TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_UNSUPPORTED_VERSION);

crypto/ts/ts_rsp_verify.c:436:10: Taking true branch
434.           goto err;
435.       }
436.       if ((flags & TS_VFY_POLICY)
                ^
437.           && !ts_check_policy(ctx->policy, tst_info))
438.           goto err;

crypto/ts/ts_rsp_verify.c:437:13: 
435.       }
436.       if ((flags & TS_VFY_POLICY)
437. >         && !ts_check_policy(ctx->policy, tst_info))
438.           goto err;
439.       if ((flags & TS_VFY_IMPRINT)

crypto/ts/ts_rsp_verify.c:552:1: start of procedure ts_check_policy()
  550.   }
  551.   
  552. > static int ts_check_policy(const ASN1_OBJECT *req_oid,
  553.                              const TS_TST_INFO *tst_info)
  554.   {

crypto/ts/ts_rsp_verify.c:555:5: 
  553.                              const TS_TST_INFO *tst_info)
  554.   {
  555. >     const ASN1_OBJECT *resp_oid = tst_info->policy_id;
  556.   
  557.       if (OBJ_cmp(req_oid, resp_oid) != 0) {

crypto/ts/ts_rsp_verify.c:557:9: 
  555.       const ASN1_OBJECT *resp_oid = tst_info->policy_id;
  556.   
  557. >     if (OBJ_cmp(req_oid, resp_oid) != 0) {
  558.           TSerr(TS_F_TS_CHECK_POLICY, TS_R_POLICY_MISMATCH);
  559.           return 0;

crypto/objects/obj_lib.c:58:1: start of procedure OBJ_cmp()
    56.   }
    57.   
    58. > int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
    59.   {
    60.       int ret;

crypto/objects/obj_lib.c:62:5: 
    60.       int ret;
    61.   
    62. >     ret = (a->length - b->length);
    63.       if (ret)
    64.           return (ret);

crypto/objects/obj_lib.c:63:9: Taking true branch
    61.   
    62.       ret = (a->length - b->length);
    63.       if (ret)
                  ^
    64.           return (ret);
    65.       return (memcmp(a->data, b->data, a->length));

crypto/objects/obj_lib.c:64:9: 
    62.       ret = (a->length - b->length);
    63.       if (ret)
    64. >         return (ret);
    65.       return (memcmp(a->data, b->data, a->length));
    66.   }

crypto/objects/obj_lib.c:66:1: return from a call to OBJ_cmp
    64.           return (ret);
    65.       return (memcmp(a->data, b->data, a->length));
    66. > }

crypto/ts/ts_rsp_verify.c:557:9: Taking false branch
  555.       const ASN1_OBJECT *resp_oid = tst_info->policy_id;
  556.   
  557.       if (OBJ_cmp(req_oid, resp_oid) != 0) {
                 ^
  558.           TSerr(TS_F_TS_CHECK_POLICY, TS_R_POLICY_MISMATCH);
  559.           return 0;

crypto/ts/ts_rsp_verify.c:562:5: 
  560.       }
  561.   
  562. >     return 1;
  563.   }
  564.   

crypto/ts/ts_rsp_verify.c:563:1: return from a call to ts_check_policy
  561.   
  562.       return 1;
  563. > }
  564.   
  565.   static int ts_compute_imprint(BIO *data, TS_TST_INFO *tst_info,

crypto/ts/ts_rsp_verify.c:437:13: Taking false branch
435.       }
436.       if ((flags & TS_VFY_POLICY)
437.           && !ts_check_policy(ctx->policy, tst_info))
                   ^
438.           goto err;
439.       if ((flags & TS_VFY_IMPRINT)

crypto/ts/ts_rsp_verify.c:439:10: Taking true branch
437.           && !ts_check_policy(ctx->policy, tst_info))
438.           goto err;
439.       if ((flags & TS_VFY_IMPRINT)
                ^
440.           && !ts_check_imprints(ctx->md_alg, ctx->imprint, ctx->imprint_len,
441.                                 tst_info))

crypto/ts/ts_rsp_verify.c:440:13: Taking false branch
438.           goto err;
439.       if ((flags & TS_VFY_IMPRINT)
440.           && !ts_check_imprints(ctx->md_alg, ctx->imprint, ctx->imprint_len,
                   ^
441.                                 tst_info))
442.           goto err;

crypto/ts/ts_rsp_verify.c:443:10: Taking false branch
441.                                 tst_info))
442.           goto err;
443.       if ((flags & TS_VFY_DATA)
                ^
444.           && (!ts_compute_imprint(ctx->data, tst_info,
445.                                   &md_alg, &imprint, &imprint_len)

crypto/ts/ts_rsp_verify.c:448:10: Taking false branch
446.               || !ts_check_imprints(md_alg, imprint, imprint_len, tst_info)))
447.           goto err;
448.       if ((flags & TS_VFY_NONCE)
                ^
449.           && !ts_check_nonces(ctx->nonce, tst_info))
450.           goto err;

crypto/ts/ts_rsp_verify.c:451:10: Taking true branch
449.           && !ts_check_nonces(ctx->nonce, tst_info))
450.           goto err;
451.       if ((flags & TS_VFY_SIGNER)
                ^
452.           && tsa_name && !ts_check_signer_name(tsa_name, signer)) {
453.           TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_NAME_MISMATCH);

crypto/ts/ts_rsp_verify.c:452:12: Taking true branch
450.           goto err;
451.       if ((flags & TS_VFY_SIGNER)
452.           && tsa_name && !ts_check_signer_name(tsa_name, signer)) {
                  ^
453.           TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_NAME_MISMATCH);
454.           goto err;

crypto/ts/ts_rsp_verify.c:452:25: 
450.           goto err;
451.       if ((flags & TS_VFY_SIGNER)
452. >         && tsa_name && !ts_check_signer_name(tsa_name, signer)) {
453.           TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_NAME_MISMATCH);
454.           goto err;
