crypto/txt_db/txt_db.c:84: error: NULL_DEREFERENCE
  pointer `buf->data` last assigned on line 83 could be null and is dereferenced by call to `BUF_MEM_grow()` at line 84, column 7.
Showing all 31 steps of the trace


crypto/txt_db/txt_db.c:71:1: start of procedure TXT_DB_read()
69.   const char *TXT_DB_version="TXT_DB" OPENSSL_VERSION_PTEXT;
70.   
71. > TXT_DB *TXT_DB_read(BIO *in, int num)
72.   	{
73.   	TXT_DB *ret=NULL;

crypto/txt_db/txt_db.c:73:2: 
71.   TXT_DB *TXT_DB_read(BIO *in, int num)
72.   	{
73. > 	TXT_DB *ret=NULL;
74.   	int er=1;
75.   	int esc=0;

crypto/txt_db/txt_db.c:74:2: 
72.   	{
73.   	TXT_DB *ret=NULL;
74. > 	int er=1;
75.   	int esc=0;
76.   	long ln=0;

crypto/txt_db/txt_db.c:75:2: 
73.   	TXT_DB *ret=NULL;
74.   	int er=1;
75. > 	int esc=0;
76.   	long ln=0;
77.   	int i,add,n;

crypto/txt_db/txt_db.c:76:2: 
74.   	int er=1;
75.   	int esc=0;
76. > 	long ln=0;
77.   	int i,add,n;
78.   	int size=BUFSIZE;

crypto/txt_db/txt_db.c:78:2: 
76.   	long ln=0;
77.   	int i,add,n;
78. > 	int size=BUFSIZE;
79.   	int offset=0;
80.   	char *p,**pp,*f;

crypto/txt_db/txt_db.c:79:2: 
77.   	int i,add,n;
78.   	int size=BUFSIZE;
79. > 	int offset=0;
80.   	char *p,**pp,*f;
81.   	BUF_MEM *buf=NULL;

crypto/txt_db/txt_db.c:81:2: 
79.   	int offset=0;
80.   	char *p,**pp,*f;
81. > 	BUF_MEM *buf=NULL;
82.   
83.   	if ((buf=BUF_MEM_new()) == NULL) goto err;

crypto/txt_db/txt_db.c:83:6: 
81.   	BUF_MEM *buf=NULL;
82.   
83. > 	if ((buf=BUF_MEM_new()) == NULL) goto err;
84.   	if (!BUF_MEM_grow(buf,size)) goto err;
85.   

crypto/buffer/buffer.c:63:1: start of procedure BUF_MEM_new()
  61.   #include "buffer.h"
  62.   
  63. > BUF_MEM *BUF_MEM_new(void)
  64.   	{
  65.   	BUF_MEM *ret;

crypto/buffer/buffer.c:67:2: 
  65.   	BUF_MEM *ret;
  66.   
  67. > 	ret=(BUF_MEM *)Malloc(sizeof(BUF_MEM));
  68.   	if (ret == NULL)
  69.   		{

crypto/buffer/buffer.c:68:6: Taking false branch
  66.   
  67.   	ret=(BUF_MEM *)Malloc(sizeof(BUF_MEM));
  68.   	if (ret == NULL)
             ^
  69.   		{
  70.   		BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);

crypto/buffer/buffer.c:73:2: 
  71.   		return(NULL);
  72.   		}
  73. > 	ret->length=0;
  74.   	ret->max=0;
  75.   	ret->data=NULL;

crypto/buffer/buffer.c:74:2: 
  72.   		}
  73.   	ret->length=0;
  74. > 	ret->max=0;
  75.   	ret->data=NULL;
  76.   	return(ret);

crypto/buffer/buffer.c:75:2: 
  73.   	ret->length=0;
  74.   	ret->max=0;
  75. > 	ret->data=NULL;
  76.   	return(ret);
  77.   	}

crypto/buffer/buffer.c:76:2: 
  74.   	ret->max=0;
  75.   	ret->data=NULL;
  76. > 	return(ret);
  77.   	}
  78.   

crypto/buffer/buffer.c:77:2: return from a call to BUF_MEM_new
  75.   	ret->data=NULL;
  76.   	return(ret);
  77.   	}
         ^
  78.   
  79.   void BUF_MEM_free(BUF_MEM *a)

crypto/txt_db/txt_db.c:83:6: Taking false branch
81.   	BUF_MEM *buf=NULL;
82.   
83.   	if ((buf=BUF_MEM_new()) == NULL) goto err;
           ^
84.   	if (!BUF_MEM_grow(buf,size)) goto err;
85.   

crypto/txt_db/txt_db.c:84:7: 
82.   
83.   	if ((buf=BUF_MEM_new()) == NULL) goto err;
84. > 	if (!BUF_MEM_grow(buf,size)) goto err;
85.   
86.   	if ((ret=(TXT_DB *)Malloc(sizeof(TXT_DB))) == NULL)

crypto/buffer/buffer.c:92:1: start of procedure BUF_MEM_grow()
  90.   	}
  91.   
  92. > int BUF_MEM_grow(BUF_MEM *str, int len)
  93.   	{
  94.   	char *ret;

crypto/buffer/buffer.c:97:6: Taking false branch
  95.   	unsigned int n;
  96.   
  97.   	if (str->length >= len)
              ^
  98.   		{
  99.   		str->length=len;

crypto/buffer/buffer.c:102:6: Taking false branch
  100.   		return(len);
  101.   		}
  102.   	if (str->max >= len)
              ^
  103.   		{
  104.   		memset(&(str->data[str->length]),0,len-str->length);

crypto/buffer/buffer.c:108:2: 
  106.   		return(len);
  107.   		}
  108. > 	n=(len+3)/3*4;
  109.   	if (str->data == NULL)
  110.   		ret=(char *)Malloc(n);

crypto/buffer/buffer.c:109:6: Taking false branch
  107.   		}
  108.   	n=(len+3)/3*4;
  109.   	if (str->data == NULL)
              ^
  110.   		ret=(char *)Malloc(n);
  111.   	else

crypto/buffer/buffer.c:112:3: 
  110.   		ret=(char *)Malloc(n);
  111.   	else
  112. > 		ret=(char *)Realloc(str->data,n);
  113.   	if (ret == NULL)
  114.   		{

crypto/buffer/buffer.c:113:6: Taking false branch
  111.   	else
  112.   		ret=(char *)Realloc(str->data,n);
  113.   	if (ret == NULL)
              ^
  114.   		{
  115.   		BUFerr(BUF_F_BUF_MEM_GROW,ERR_R_MALLOC_FAILURE);

crypto/buffer/buffer.c:120:3: 
  118.   	else
  119.   		{
  120. > 		str->data=ret;
  121.   		str->length=len;
  122.   		str->max=n;

crypto/buffer/buffer.c:121:3: 
  119.   		{
  120.   		str->data=ret;
  121. > 		str->length=len;
  122.   		str->max=n;
  123.   		}

crypto/buffer/buffer.c:122:3: 
  120.   		str->data=ret;
  121.   		str->length=len;
  122. > 		str->max=n;
  123.   		}
  124.   	return(len);

crypto/buffer/buffer.c:124:2: 
  122.   		str->max=n;
  123.   		}
  124. > 	return(len);
  125.   	}
  126.   

crypto/buffer/buffer.c:125:2: return from a call to BUF_MEM_grow
  123.   		}
  124.   	return(len);
  125.   	}
          ^
  126.   
  127.   char *BUF_strdup(const char *str)
