crypto/asn1/a_utctm.c:297: error: NULL_DEREFERENCE
  pointer `tm` last assigned on line 290 could be null and is dereferenced at line 297, column 2.
Showing all 8 steps of the trace


crypto/asn1/a_utctm.c:268:1: start of procedure ASN1_UTCTIME_cmp_time_t()
266.   
267.   
268. > int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
269.   	{
270.   	struct tm *tm;

crypto/asn1/a_utctm.c:276:6: Taking true branch
274.   #define g2(p) (((p)[0]-'0')*10+(p)[1]-'0')
275.   
276.   	if (s->data[12] == 'Z')
            ^
277.   		offset=0;
278.   	else

crypto/asn1/a_utctm.c:277:3: 
275.   
276.   	if (s->data[12] == 'Z')
277. > 		offset=0;
278.   	else
279.   		{

crypto/asn1/a_utctm.c:285:2: 
283.   		}
284.   
285. > 	t -= offset*60; /* FIXME: may overflow in extreme cases */
286.   
287.   #if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__)

crypto/asn1/a_utctm.c:290:2: 
288.   	{ struct tm data; gmtime_r(&t, &data); tm = &data; }
289.   #else
290. > 	tm = gmtime(&t);
291.   #endif
292.   	

crypto/asn1/a_utctm.c:294:2: 
292.   	
293.   #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1
294. > 	year = g2(s->data);
295.   	if (year < 50)
296.   		year += 100;

crypto/asn1/a_utctm.c:295:6: Taking false branch
293.   #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1
294.   	year = g2(s->data);
295.   	if (year < 50)
            ^
296.   		year += 100;
297.   	return_cmp(year,              tm->tm_year);

crypto/asn1/a_utctm.c:297:2: 
295.   	if (year < 50)
296.   		year += 100;
297. > 	return_cmp(year,              tm->tm_year);
298.   	return_cmp(g2(s->data+2) - 1, tm->tm_mon);
299.   	return_cmp(g2(s->data+4),     tm->tm_mday);
