ssl/t1_lib.c:265: error: NULL_DEREFERENCE
  pointer `ginfo` last assigned on line 262 could be null and is dereferenced at line 265, column 14.
Showing all 12 steps of the trace


ssl/t1_lib.c:260:1: start of procedure tls_valid_group()
258.   }
259.   
260. > int tls_valid_group(SSL *s, uint16_t group_id, int version)
261.   {
262.       const TLS_GROUP_INFO *ginfo = tls1_group_id_lookup(group_id);

ssl/t1_lib.c:262:5: 
260.   int tls_valid_group(SSL *s, uint16_t group_id, int version)
261.   {
262. >     const TLS_GROUP_INFO *ginfo = tls1_group_id_lookup(group_id);
263.   
264.       if (version < TLS1_3_VERSION) {

ssl/t1_lib.c:200:1: start of procedure tls1_group_id_lookup()
  198.   };
  199.   
  200. > const TLS_GROUP_INFO *tls1_group_id_lookup(uint16_t group_id)
  201.   {
  202.       size_t i;

ssl/t1_lib.c:205:10: 
  203.   
  204.       /* ECC curves from RFC 4492 and RFC 7027 FFDHE group from RFC 8446 */
  205. >     for (i = 0; i < OSSL_NELEM(nid_list); i++) {
  206.           if (nid_list[i].group_id == group_id)
  207.               return &nid_list[i];

ssl/t1_lib.c:205:17: Loop condition is true. Entering loop body
  203.   
  204.       /* ECC curves from RFC 4492 and RFC 7027 FFDHE group from RFC 8446 */
  205.       for (i = 0; i < OSSL_NELEM(nid_list); i++) {
                         ^
  206.           if (nid_list[i].group_id == group_id)
  207.               return &nid_list[i];

ssl/t1_lib.c:206:13: Taking false branch
  204.       /* ECC curves from RFC 4492 and RFC 7027 FFDHE group from RFC 8446 */
  205.       for (i = 0; i < OSSL_NELEM(nid_list); i++) {
  206.           if (nid_list[i].group_id == group_id)
                     ^
  207.               return &nid_list[i];
  208.       }

ssl/t1_lib.c:205:43: 
  203.   
  204.       /* ECC curves from RFC 4492 and RFC 7027 FFDHE group from RFC 8446 */
  205. >     for (i = 0; i < OSSL_NELEM(nid_list); i++) {
  206.           if (nid_list[i].group_id == group_id)
  207.               return &nid_list[i];

ssl/t1_lib.c:205:17: Loop condition is false. Leaving loop
  203.   
  204.       /* ECC curves from RFC 4492 and RFC 7027 FFDHE group from RFC 8446 */
  205.       for (i = 0; i < OSSL_NELEM(nid_list); i++) {
                         ^
  206.           if (nid_list[i].group_id == group_id)
  207.               return &nid_list[i];

ssl/t1_lib.c:209:5: 
  207.               return &nid_list[i];
  208.       }
  209. >     return NULL;
  210.   }
  211.   

ssl/t1_lib.c:210:1: return from a call to tls1_group_id_lookup
  208.       }
  209.       return NULL;
  210. > }
  211.   
  212.   static uint16_t tls1_nid2group_id(int nid)

ssl/t1_lib.c:264:9: Taking true branch
262.       const TLS_GROUP_INFO *ginfo = tls1_group_id_lookup(group_id);
263.   
264.       if (version < TLS1_3_VERSION) {
               ^
265.           if ((ginfo->flags & TLS_GROUP_ONLY_FOR_TLS1_3) != 0)
266.               return 0;

ssl/t1_lib.c:265:13: 
263.   
264.       if (version < TLS1_3_VERSION) {
265. >         if ((ginfo->flags & TLS_GROUP_ONLY_FOR_TLS1_3) != 0)
266.               return 0;
267.       }

int tls_valid_group(SSL *s, uint16_t group_id, int version)
{
    const TLS_GROUP_INFO *ginfo = tls1_group_id_lookup(group_id);
    if (version < TLS1_3_VERSION) {
        if ((ginfo->flags & TLS_GROUP_ONLY_FOR_TLS1_3) != 0)
            return 0;
    }
    return 1;
}
['int tls_valid_group(SSL *s, uint16_t group_id, int version)\n{\n    const TLS_GROUP_INFO *ginfo = tls1_group_id_lookup(group_id);\n    if (version < TLS1_3_VERSION) {\n        if ((ginfo->flags & TLS_GROUP_ONLY_FOR_TLS1_3) != 0)\n            return 0;\n    }\n    return 1;\n}', 'const TLS_GROUP_INFO *tls1_group_id_lookup(uint16_t group_id)\n{\n    size_t i;\n    for (i = 0; i < OSSL_NELEM(nid_list); i++) {\n        if (nid_list[i].group_id == group_id)\n            return &nid_list[i];\n    }\n    return NULL;\n}']