crypto/objects/obj_dat.c:480: error: NULL_DEREFERENCE
  pointer `s` last assigned on line 479 could be null and is dereferenced by call to `strncpy()` at line 480, column 3.
Showing all 29 steps of the trace


crypto/objects/obj_dat.c:421:1: start of procedure OBJ_obj2txt()
419.   	}
420.   
421. > int OBJ_obj2txt(char *buf, int buf_len, ASN1_OBJECT *a, int no_name)
422.   {
423.   	int i,idx=0,n=0,len,nid;

crypto/objects/obj_dat.c:423:2: 
421.   int OBJ_obj2txt(char *buf, int buf_len, ASN1_OBJECT *a, int no_name)
422.   {
423. > 	int i,idx=0,n=0,len,nid;
424.   	unsigned long l;
425.   	unsigned char *p;

crypto/objects/obj_dat.c:429:6: Taking false branch
427.   	char tbuf[32];
428.   
429.   	if (buf_len <= 0) return(0);
            ^
430.   
431.   	if ((a == NULL) || (a->data == NULL)) {

crypto/objects/obj_dat.c:431:7: Taking false branch
429.   	if (buf_len <= 0) return(0);
430.   
431.   	if ((a == NULL) || (a->data == NULL)) {
             ^
432.   		buf[0]='\0';
433.   		return(0);

crypto/objects/obj_dat.c:431:22: Taking false branch
429.   	if (buf_len <= 0) return(0);
430.   
431.   	if ((a == NULL) || (a->data == NULL)) {
                            ^
432.   		buf[0]='\0';
433.   		return(0);

crypto/objects/obj_dat.c:436:2: 
434.   	}
435.   
436. > 	nid=OBJ_obj2nid(a);
437.   	if ((nid == NID_undef) || no_name) {
438.   		len=a->length;

crypto/objects/obj_dat.c:354:1: start of procedure OBJ_obj2nid()
  352.   	}
  353.   
  354. > int OBJ_obj2nid(ASN1_OBJECT *a)
  355.   	{
  356.   	ASN1_OBJECT **op;

crypto/objects/obj_dat.c:359:6: Taking false branch
  357.   	ADDED_OBJ ad,*adp;
  358.   
  359.   	if (a == NULL)
              ^
  360.   		return(NID_undef);
  361.   	if (a->nid != 0)

crypto/objects/obj_dat.c:361:6: Taking true branch
  359.   	if (a == NULL)
  360.   		return(NID_undef);
  361.   	if (a->nid != 0)
              ^
  362.   		return(a->nid);
  363.   

crypto/objects/obj_dat.c:362:3: 
  360.   		return(NID_undef);
  361.   	if (a->nid != 0)
  362. > 		return(a->nid);
  363.   
  364.   	if (added != NULL)

crypto/objects/obj_dat.c:376:2: return from a call to OBJ_obj2nid
  374.   		return(NID_undef);
  375.   	return((*op)->nid);
  376.   	}
          ^
  377.   
  378.   /* Convert an object name into an ASN1_OBJECT

crypto/objects/obj_dat.c:437:7: Taking false branch
435.   
436.   	nid=OBJ_obj2nid(a);
437.   	if ((nid == NID_undef) || no_name) {
             ^
438.   		len=a->length;
439.   		p=a->data;

crypto/objects/obj_dat.c:437:28: Taking false branch
435.   
436.   	nid=OBJ_obj2nid(a);
437.   	if ((nid == NID_undef) || no_name) {
                                  ^
438.   		len=a->length;
439.   		p=a->data;

crypto/objects/obj_dat.c:477:3: 
475.   		}
476.   	} else {
477. > 		s=OBJ_nid2ln(nid);
478.   		if (s == NULL)
479.   			s=OBJ_nid2sn(nid);

crypto/objects/obj_dat.c:322:1: start of procedure OBJ_nid2ln()
  320.   	}
  321.   
  322. > const char *OBJ_nid2ln(int n)
  323.   	{
  324.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:327:7: Taking true branch
  325.   	ASN1_OBJECT ob;
  326.   
  327.   	if ((n >= 0) && (n < NUM_NID))
               ^
  328.   		{
  329.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:327:19: Taking false branch
  325.   	ASN1_OBJECT ob;
  326.   
  327.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  328.   		{
  329.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:336:11: Taking true branch
  334.   		return(nid_objs[n].ln);
  335.   		}
  336.   	else if (added == NULL)
                   ^
  337.   		return(NULL);
  338.   	else

crypto/objects/obj_dat.c:337:3: 
  335.   		}
  336.   	else if (added == NULL)
  337. > 		return(NULL);
  338.   	else
  339.   		{

crypto/objects/obj_dat.c:352:2: return from a call to OBJ_nid2ln
  350.   			}
  351.   		}
  352.   	}
          ^
  353.   
  354.   int OBJ_obj2nid(ASN1_OBJECT *a)

crypto/objects/obj_dat.c:478:7: Taking true branch
476.   	} else {
477.   		s=OBJ_nid2ln(nid);
478.   		if (s == NULL)
             ^
479.   			s=OBJ_nid2sn(nid);
480.   		strncpy(buf,s,buf_len);

crypto/objects/obj_dat.c:479:4: 
477.   		s=OBJ_nid2ln(nid);
478.   		if (s == NULL)
479. > 			s=OBJ_nid2sn(nid);
480.   		strncpy(buf,s,buf_len);
481.   		n=strlen(s);

crypto/objects/obj_dat.c:290:1: start of procedure OBJ_nid2sn()
  288.   	}
  289.   
  290. > const char *OBJ_nid2sn(int n)
  291.   	{
  292.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:295:7: Taking true branch
  293.   	ASN1_OBJECT ob;
  294.   
  295.   	if ((n >= 0) && (n < NUM_NID))
               ^
  296.   		{
  297.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:295:19: Taking false branch
  293.   	ASN1_OBJECT ob;
  294.   
  295.   	if ((n >= 0) && (n < NUM_NID))
                           ^
  296.   		{
  297.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:304:11: Taking true branch
  302.   		return(nid_objs[n].sn);
  303.   		}
  304.   	else if (added == NULL)
                   ^
  305.   		return(NULL);
  306.   	else

crypto/objects/obj_dat.c:305:3: 
  303.   		}
  304.   	else if (added == NULL)
  305. > 		return(NULL);
  306.   	else
  307.   		{

crypto/objects/obj_dat.c:320:2: return from a call to OBJ_nid2sn
  318.   			}
  319.   		}
  320.   	}
          ^
  321.   
  322.   const char *OBJ_nid2ln(int n)

crypto/objects/obj_dat.c:480:3: 
478.   		if (s == NULL)
479.   			s=OBJ_nid2sn(nid);
480. > 		strncpy(buf,s,buf_len);
481.   		n=strlen(s);
482.   	}
