apps/apps.c:397: error: NULL_DEREFERENCE
  pointer `arg->data` last assigned on line 394 could be null and is dereferenced at line 397, column 3.
Showing all 23 steps of the trace


apps/apps.c:382:1: start of procedure chopup_args()
380.   #endif
381.   
382. > int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
383.   	{
384.   	int num,i;

apps/apps.c:387:2: 
385.   	char *p;
386.   
387. > 	*argc=0;
388.   	*argv=NULL;
389.   

apps/apps.c:388:2: 
386.   
387.   	*argc=0;
388. > 	*argv=NULL;
389.   
390.   	i=0;

apps/apps.c:390:2: 
388.   	*argv=NULL;
389.   
390. > 	i=0;
391.   	if (arg->count == 0)
392.   		{

apps/apps.c:391:6: Taking true branch
389.   
390.   	i=0;
391.   	if (arg->count == 0)
            ^
392.   		{
393.   		arg->count=20;

apps/apps.c:393:3: 
391.   	if (arg->count == 0)
392.   		{
393. > 		arg->count=20;
394.   		arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count);
395.   		}

apps/apps.c:394:3: 
392.   		{
393.   		arg->count=20;
394. > 		arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count);
395.   		}
396.   	for (i=0; i<arg->count; i++)

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

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

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

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

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

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

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

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

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

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

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

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

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

apps/apps.c:396:7: 
394.   		arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count);
395.   		}
396. > 	for (i=0; i<arg->count; i++)
397.   		arg->data[i]=NULL;
398.   

apps/apps.c:396:12: Loop condition is true. Entering loop body
394.   		arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count);
395.   		}
396.   	for (i=0; i<arg->count; i++)
                  ^
397.   		arg->data[i]=NULL;
398.   

apps/apps.c:397:3: 
395.   		}
396.   	for (i=0; i<arg->count; i++)
397. > 		arg->data[i]=NULL;
398.   
399.   	num=0;
