crypto/asn1/a_object.c:244: error: NULL_DEREFERENCE
  pointer `s` last assigned on line 243 could be null and is dereferenced by call to `strncpy()` at line 244, column 3.
Showing all 28 steps of the trace


crypto/asn1/a_object.c:178:1: start of procedure i2t_ASN1_OBJECT()
176.   	}
177.   
178. > int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a)
179.   	{
180.   	int i,idx=0,n=0,len,nid;

crypto/asn1/a_object.c:180:2: 
178.   int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a)
179.   	{
180. > 	int i,idx=0,n=0,len,nid;
181.   	unsigned long l;
182.   	unsigned char *p;

crypto/asn1/a_object.c:186:6: Taking false branch
184.   	char tbuf[32];
185.   
186.   	if (buf_len <= 0) return(0);
            ^
187.   
188.   	if ((a == NULL) || (a->data == NULL))

crypto/asn1/a_object.c:188:7: Taking false branch
186.   	if (buf_len <= 0) return(0);
187.   
188.   	if ((a == NULL) || (a->data == NULL))
             ^
189.   		{
190.   		buf[0]='\0';

crypto/asn1/a_object.c:188:22: Taking false branch
186.   	if (buf_len <= 0) return(0);
187.   
188.   	if ((a == NULL) || (a->data == NULL))
                            ^
189.   		{
190.   		buf[0]='\0';

crypto/asn1/a_object.c:194:2: 
192.   		}
193.   
194. > 	nid=OBJ_obj2nid(a);
195.   	if (nid == NID_undef)
196.   		{

crypto/objects/obj_dat.c:361:1: start of procedure OBJ_obj2nid()
  359.   	}
  360.   
  361. > int OBJ_obj2nid(ASN1_OBJECT *a)
  362.   	{
  363.   	ASN1_OBJECT **op;

crypto/objects/obj_dat.c:366:6: Taking false branch
  364.   	ADDED_OBJ ad,*adp;
  365.   
  366.   	if (a == NULL)
              ^
  367.   		return(NID_undef);
  368.   	if (a->nid != 0)

crypto/objects/obj_dat.c:368:6: Taking true branch
  366.   	if (a == NULL)
  367.   		return(NID_undef);
  368.   	if (a->nid != 0)
              ^
  369.   		return(a->nid);
  370.   

crypto/objects/obj_dat.c:369:3: 
  367.   		return(NID_undef);
  368.   	if (a->nid != 0)
  369. > 		return(a->nid);
  370.   
  371.   	if (added != NULL)

crypto/objects/obj_dat.c:383:2: return from a call to OBJ_obj2nid
  381.   		return(NID_undef);
  382.   	return((*op)->nid);
  383.   	}
          ^
  384.   
  385.   /* Convert an object name into an ASN1_OBJECT

crypto/asn1/a_object.c:195:6: Taking false branch
193.   
194.   	nid=OBJ_obj2nid(a);
195.   	if (nid == NID_undef)
            ^
196.   		{
197.   		len=a->length;

crypto/asn1/a_object.c:241:3: 
239.   	else
240.   		{
241. > 		s=OBJ_nid2ln(nid);
242.   		if (s == NULL)
243.   			s=OBJ_nid2sn(nid);

crypto/objects/obj_dat.c:329:1: start of procedure OBJ_nid2ln()
  327.   	}
  328.   
  329. > const char *OBJ_nid2ln(int n)
  330.   	{
  331.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:334:7: Taking true branch
  332.   	ASN1_OBJECT ob;
  333.   
  334.   	if ((n >= 0) && (n < NUM_NID))
               ^
  335.   		{
  336.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:334:19: Taking false branch
  332.   	ASN1_OBJECT ob;
  333.   
  334.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  335.   		{
  336.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:343:11: Taking true branch
  341.   		return(nid_objs[n].ln);
  342.   		}
  343.   	else if (added == NULL)
                   ^
  344.   		return(NULL);
  345.   	else

crypto/objects/obj_dat.c:344:3: 
  342.   		}
  343.   	else if (added == NULL)
  344. > 		return(NULL);
  345.   	else
  346.   		{

crypto/objects/obj_dat.c:359:2: return from a call to OBJ_nid2ln
  357.   			}
  358.   		}
  359.   	}
          ^
  360.   
  361.   int OBJ_obj2nid(ASN1_OBJECT *a)

crypto/asn1/a_object.c:242:7: Taking true branch
240.   		{
241.   		s=OBJ_nid2ln(nid);
242.   		if (s == NULL)
             ^
243.   			s=OBJ_nid2sn(nid);
244.   		strncpy(buf,s,buf_len);

crypto/asn1/a_object.c:243:4: 
241.   		s=OBJ_nid2ln(nid);
242.   		if (s == NULL)
243. > 			s=OBJ_nid2sn(nid);
244.   		strncpy(buf,s,buf_len);
245.   		n=strlen(s);

crypto/objects/obj_dat.c:297:1: start of procedure OBJ_nid2sn()
  295.   	}
  296.   
  297. > const char *OBJ_nid2sn(int n)
  298.   	{
  299.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:302:7: Taking true branch
  300.   	ASN1_OBJECT ob;
  301.   
  302.   	if ((n >= 0) && (n < NUM_NID))
               ^
  303.   		{
  304.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:302:19: Taking false branch
  300.   	ASN1_OBJECT ob;
  301.   
  302.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  303.   		{
  304.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:311:11: Taking true branch
  309.   		return(nid_objs[n].sn);
  310.   		}
  311.   	else if (added == NULL)
                   ^
  312.   		return(NULL);
  313.   	else

crypto/objects/obj_dat.c:312:3: 
  310.   		}
  311.   	else if (added == NULL)
  312. > 		return(NULL);
  313.   	else
  314.   		{

crypto/objects/obj_dat.c:327:2: return from a call to OBJ_nid2sn
  325.   			}
  326.   		}
  327.   	}
          ^
  328.   
  329.   const char *OBJ_nid2ln(int n)

crypto/asn1/a_object.c:244:3: 
242.   		if (s == NULL)
243.   			s=OBJ_nid2sn(nid);
244. > 		strncpy(buf,s,buf_len);
245.   		n=strlen(s);
246.   		}
