crypto/ts/ts_rsp_verify.c:465: 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 465, column 13.
Showing all 30 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.   

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

crypto/ts/ts_rsp_verify.c:422:10: Taking false branch
420.   
421.       /* Verify the signature. */
422.       if ((ctx->flags & TS_VFY_SIGNATURE)
                ^
423.           && !TS_RESP_verify_signature(token, ctx->certs, ctx->store, &signer))
424.           goto err;

crypto/ts/ts_rsp_verify.c:427:10: Taking false branch
425.   
426.       /* Check version number of response. */
427.       if ((ctx->flags & TS_VFY_VERSION)
                ^
428.           && TS_TST_INFO_get_version(tst_info) != 1) {
429.           TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_UNSUPPORTED_VERSION);

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

crypto/ts/ts_rsp_verify.c:435:13: 
433.       /* Check policies. */
434.       if ((ctx->flags & TS_VFY_POLICY)
435. >         && !ts_check_policy(ctx->policy, tst_info))
436.           goto err;
437.   

crypto/ts/ts_rsp_verify.c:564:1: start of procedure ts_check_policy()
  562.   }
  563.   
  564. > static int ts_check_policy(ASN1_OBJECT *req_oid, TS_TST_INFO *tst_info)
  565.   {
  566.       ASN1_OBJECT *resp_oid = tst_info->policy_id;

crypto/ts/ts_rsp_verify.c:566:5: 
  564.   static int ts_check_policy(ASN1_OBJECT *req_oid, TS_TST_INFO *tst_info)
  565.   {
  566. >     ASN1_OBJECT *resp_oid = tst_info->policy_id;
  567.   
  568.       if (OBJ_cmp(req_oid, resp_oid) != 0) {

crypto/ts/ts_rsp_verify.c:568:9: 
  566.       ASN1_OBJECT *resp_oid = tst_info->policy_id;
  567.   
  568. >     if (OBJ_cmp(req_oid, resp_oid) != 0) {
  569.           TSerr(TS_F_TS_CHECK_POLICY, TS_R_POLICY_MISMATCH);
  570.           return 0;

crypto/objects/obj_lib.c:124:1: start of procedure OBJ_cmp()
    122.   }
    123.   
    124. > int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
    125.   {
    126.       int ret;

crypto/objects/obj_lib.c:128:5: 
    126.       int ret;
    127.   
    128. >     ret = (a->length - b->length);
    129.       if (ret)
    130.           return (ret);

crypto/objects/obj_lib.c:129:9: Taking true branch
    127.   
    128.       ret = (a->length - b->length);
    129.       if (ret)
                   ^
    130.           return (ret);
    131.       return (memcmp(a->data, b->data, a->length));

crypto/objects/obj_lib.c:130:9: 
    128.       ret = (a->length - b->length);
    129.       if (ret)
    130. >         return (ret);
    131.       return (memcmp(a->data, b->data, a->length));
    132.   }

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

crypto/ts/ts_rsp_verify.c:568:9: Taking false branch
  566.       ASN1_OBJECT *resp_oid = tst_info->policy_id;
  567.   
  568.       if (OBJ_cmp(req_oid, resp_oid) != 0) {
                 ^
  569.           TSerr(TS_F_TS_CHECK_POLICY, TS_R_POLICY_MISMATCH);
  570.           return 0;

crypto/ts/ts_rsp_verify.c:573:5: 
  571.       }
  572.   
  573. >     return 1;
  574.   }
  575.   

crypto/ts/ts_rsp_verify.c:574:1: return from a call to ts_check_policy
  572.   
  573.       return 1;
  574. > }
  575.   
  576.   static int ts_compute_imprint(BIO *data, TS_TST_INFO *tst_info,

crypto/ts/ts_rsp_verify.c:435:13: Taking false branch
433.       /* Check policies. */
434.       if ((ctx->flags & TS_VFY_POLICY)
435.           && !ts_check_policy(ctx->policy, tst_info))
                   ^
436.           goto err;
437.   

crypto/ts/ts_rsp_verify.c:439:10: Taking true branch
437.   
438.       /* Check message imprints. */
439.       if ((ctx->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.       /* Check message imprints. */
439.       if ((ctx->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:445:10: Taking false branch
443.   
444.       /* Compute and check message imprints. */
445.       if ((ctx->flags & TS_VFY_DATA)
                ^
446.           && (!ts_compute_imprint(ctx->data, tst_info,
447.                                   &md_alg, &imprint, &imprint_len)

crypto/ts/ts_rsp_verify.c:452:10: Taking false branch
450.   
451.       /* Check nonces. */
452.       if ((ctx->flags & TS_VFY_NONCE)
                ^
453.           && !ts_check_nonces(ctx->nonce, tst_info))
454.           goto err;

crypto/ts/ts_rsp_verify.c:457:10: Taking false branch
455.   
456.       /* Check whether TSA name and signer certificate match. */
457.       if ((ctx->flags & TS_VFY_SIGNER)
                ^
458.           && tsa_name && !ts_check_signer_name(tsa_name, signer)) {
459.           TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_NAME_MISMATCH);

crypto/ts/ts_rsp_verify.c:464:10: Taking true branch
462.   
463.       /* Check whether the TSA is the expected one. */
464.       if ((ctx->flags & TS_VFY_TSA_NAME)
                ^
465.           && !ts_check_signer_name(ctx->tsa_name, signer)) {
466.           TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_UNTRUSTED);

crypto/ts/ts_rsp_verify.c:465:13: 
463.       /* Check whether the TSA is the expected one. */
464.       if ((ctx->flags & TS_VFY_TSA_NAME)
465. >         && !ts_check_signer_name(ctx->tsa_name, signer)) {
466.           TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_UNTRUSTED);
467.           goto err;
