crypto/bio/b_print.c:744: error: NULL_DEREFERENCE
  pointer `*buffer` last assigned on line 741 could be null and is dereferenced by call to `memcpy()` at line 744, column 7.
Showing all 23 steps of the trace


crypto/bio/b_print.c:725:1: start of procedure doapr_outch()
723.   }
724.   
725. > static void
726.   doapr_outch(
727.       char **sbuffer,

crypto/bio/b_print.c:734:5: 
732.   {
733.       /* If we haven't at least one buffer, someone has doe a big booboo */
734. >     assert(*sbuffer != NULL || buffer != NULL);
735.   
736.       if (buffer) {

crypto/bio/b_print.c:736:9: Taking true branch
734.       assert(*sbuffer != NULL || buffer != NULL);
735.   
736.       if (buffer) {
               ^
737.   	while (*currlen >= *maxlen) {
738.   	    if (*buffer == NULL) {

crypto/bio/b_print.c:737:9: Loop condition is true. Entering loop body
735.   
736.       if (buffer) {
737.   	while (*currlen >= *maxlen) {
               ^
738.   	    if (*buffer == NULL) {
739.   		if (*maxlen == 0)

crypto/bio/b_print.c:738:10: Taking true branch
736.       if (buffer) {
737.   	while (*currlen >= *maxlen) {
738.   	    if (*buffer == NULL) {
                ^
739.   		if (*maxlen == 0)
740.   		    *maxlen = 1024;

crypto/bio/b_print.c:739:7: Taking false branch
737.   	while (*currlen >= *maxlen) {
738.   	    if (*buffer == NULL) {
739.   		if (*maxlen == 0)
             ^
740.   		    *maxlen = 1024;
741.   		*buffer = OPENSSL_malloc(*maxlen);

crypto/bio/b_print.c:741:3: 
739.   		if (*maxlen == 0)
740.   		    *maxlen = 1024;
741. > 		*buffer = OPENSSL_malloc(*maxlen);
742.   		if (*currlen > 0) {
743.   		    assert(*sbuffer != NULL);

crypto/mem.c:294:1: start of procedure CRYPTO_malloc()
  292.   	}
  293.   
  294. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  295.   	{
  296.   	void *ret = NULL;

crypto/mem.c:296:2: 
  294.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  295.   	{
  296. > 	void *ret = NULL;
  297.   
  298.   	if (num <= 0) return NULL;

crypto/mem.c:298:6: Taking false branch
  296.   	void *ret = NULL;
  297.   
  298.   	if (num <= 0) return NULL;
              ^
  299.   
  300.   	allow_customize = 0;

crypto/mem.c:300:2: 
  298.   	if (num <= 0) return NULL;
  299.   
  300. > 	allow_customize = 0;
  301.   	if (malloc_debug_func != NULL)
  302.   		{

crypto/mem.c:301:6: Taking true branch
  299.   
  300.   	allow_customize = 0;
  301.   	if (malloc_debug_func != NULL)
              ^
  302.   		{
  303.   		allow_customize_debug = 0;

crypto/mem.c:303:3: 
  301.   	if (malloc_debug_func != NULL)
  302.   		{
  303. > 		allow_customize_debug = 0;
  304.   		malloc_debug_func(NULL, num, file, line, 0);
  305.   		}

crypto/mem.c:304:3: Skipping __function_pointer__(): unresolved function pointer
  302.   		{
  303.   		allow_customize_debug = 0;
  304.   		malloc_debug_func(NULL, num, file, line, 0);
           ^
  305.   		}
  306.   	ret = malloc_ex_func(num,file,line);

crypto/mem.c:306:2: Skipping __function_pointer__(): unresolved function pointer
  304.   		malloc_debug_func(NULL, num, file, line, 0);
  305.   		}
  306.   	ret = malloc_ex_func(num,file,line);
          ^
  307.   #ifdef LEVITTE_DEBUG_MEM
  308.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:310:6: Taking true branch
  308.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
  309.   #endif
  310.   	if (malloc_debug_func != NULL)
              ^
  311.   		malloc_debug_func(ret, num, file, line, 1);
  312.   

crypto/mem.c:311:3: Skipping __function_pointer__(): unresolved function pointer
  309.   #endif
  310.   	if (malloc_debug_func != NULL)
  311.   		malloc_debug_func(ret, num, file, line, 1);
           ^
  312.   
  313.   #ifndef OPENSSL_CPUID_OBJ

crypto/mem.c:317:12: Taking false branch
  315.            * sanitisation function can't be optimised out. NB: We only do
  316.            * this for >2Kb so the overhead doesn't bother us. */
  317.           if(ret && (num > 2048))
                    ^
  318.   	{	extern unsigned char cleanse_ctr;
  319.                   ((unsigned char *)ret)[0] = cleanse_ctr;

crypto/mem.c:323:2: 
  321.   #endif
  322.   
  323. > 	return ret;
  324.   	}
  325.   char *CRYPTO_strdup(const char *str, const char *file, int line)

crypto/mem.c:324:2: return from a call to CRYPTO_malloc
  322.   
  323.   	return ret;
  324.   	}
          ^
  325.   char *CRYPTO_strdup(const char *str, const char *file, int line)
  326.   	{

crypto/bio/b_print.c:742:7: Taking true branch
740.   		    *maxlen = 1024;
741.   		*buffer = OPENSSL_malloc(*maxlen);
742.   		if (*currlen > 0) {
             ^
743.   		    assert(*sbuffer != NULL);
744.   		    memcpy(*buffer, *sbuffer, *currlen);

crypto/bio/b_print.c:743:7: 
741.   		*buffer = OPENSSL_malloc(*maxlen);
742.   		if (*currlen > 0) {
743. > 		    assert(*sbuffer != NULL);
744.   		    memcpy(*buffer, *sbuffer, *currlen);
745.   		}

crypto/bio/b_print.c:744:7: 
742.   		if (*currlen > 0) {
743.   		    assert(*sbuffer != NULL);
744. > 		    memcpy(*buffer, *sbuffer, *currlen);
745.   		}
746.   		*sbuffer = NULL;
