ssl/ssl_lib.c:1357: error: NULL_DEREFERENCE
  pointer `sk` last assigned on line 1344 could be null and is dereferenced by call to `sk_push()` at line 1357, column 9.
Showing all 34 steps of the trace


ssl/ssl_lib.c:1330:1: start of procedure ssl_bytes_to_cipher_list()
1328.   	}
1329.   
1330. > STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num,
1331.   					       STACK_OF(SSL_CIPHER) **skp)
1332.   	{

ssl/ssl_lib.c:1337:2: Skipping __function_pointer__(): unresolved function pointer
1335.   	int i,n;
1336.   
1337.   	n=ssl_put_cipher_by_char(s,NULL,NULL);
         ^
1338.   	if ((num%n) != 0)
1339.   		{

ssl/ssl_lib.c:1338:6: Taking false branch
1336.   
1337.   	n=ssl_put_cipher_by_char(s,NULL,NULL);
1338.   	if ((num%n) != 0)
             ^
1339.   		{
1340.   		SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST);

ssl/ssl_lib.c:1343:7: Taking false branch
1341.   		return(NULL);
1342.   		}
1343.   	if ((skp == NULL) || (*skp == NULL))
              ^
1344.   		sk=sk_SSL_CIPHER_new_null(); /* change perhaps later */
1345.   	else

ssl/ssl_lib.c:1343:24: Taking true branch
1341.   		return(NULL);
1342.   		}
1343.   	if ((skp == NULL) || (*skp == NULL))
                               ^
1344.   		sk=sk_SSL_CIPHER_new_null(); /* change perhaps later */
1345.   	else

ssl/ssl_lib.c:1344:3: 
1342.   		}
1343.   	if ((skp == NULL) || (*skp == NULL))
1344. > 		sk=sk_SSL_CIPHER_new_null(); /* change perhaps later */
1345.   	else
1346.   		{

crypto/stack/stack.c:115:1: start of procedure sk_new_null()
  113.   	}
  114.   
  115. > STACK *sk_new_null(void)
  116.   	{
  117.   	return sk_new((int (*)(const char * const *, const char * const *))0);

crypto/stack/stack.c:117:2: 
  115.   STACK *sk_new_null(void)
  116.   	{
  117. > 	return sk_new((int (*)(const char * const *, const char * const *))0);
  118.   	}
  119.   

crypto/stack/stack.c:120:1: start of procedure sk_new()
    118.   	}
    119.   
    120. > STACK *sk_new(int (*c)(const char * const *, const char * const *))
    121.   	{
    122.   	STACK *ret;

crypto/stack/stack.c:125:6: 
    123.   	int i;
    124.   
    125. > 	if ((ret=(STACK *)OPENSSL_malloc(sizeof(STACK))) == NULL)
    126.   		goto err;
    127.   	if ((ret->data=(char **)OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)

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

crypto/mem.c:296:2: 
      294.   void *CRYPTO_malloc(int 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 false branch
      299.   
      300.   	allow_customize = 0;
      301.   	if (malloc_debug_func != NULL)
                  ^
      302.   		{
      303.   		allow_customize_debug = 0;

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 false 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: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.   

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

crypto/stack/stack.c:125:6: Taking true branch
    123.   	int i;
    124.   
    125.   	if ((ret=(STACK *)OPENSSL_malloc(sizeof(STACK))) == NULL)
                ^
    126.   		goto err;
    127.   	if ((ret->data=(char **)OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)

crypto/stack/stack.c:136:1: 
    134.   	ret->sorted=0;
    135.   	return(ret);
    136. > err:
    137.   	if(ret)
    138.   		OPENSSL_free(ret);

crypto/stack/stack.c:137:5: Taking false branch
    135.   	return(ret);
    136.   err:
    137.   	if(ret)
               ^
    138.   		OPENSSL_free(ret);
    139.   	return(NULL);

crypto/stack/stack.c:139:2: 
    137.   	if(ret)
    138.   		OPENSSL_free(ret);
    139. > 	return(NULL);
    140.   	}
    141.   

crypto/stack/stack.c:140:2: return from a call to sk_new
    138.   		OPENSSL_free(ret);
    139.   	return(NULL);
    140.   	}
            ^
    141.   
    142.   int sk_insert(STACK *st, char *data, int loc)

crypto/stack/stack.c:118:2: return from a call to sk_new_null
  116.   	{
  117.   	return sk_new((int (*)(const char * const *, const char * const *))0);
  118.   	}
          ^
  119.   
  120.   STACK *sk_new(int (*c)(const char * const *, const char * const *))

ssl/ssl_lib.c:1351:7: 
1349.   		}
1350.   
1351. > 	for (i=0; i<num; i+=n)
1352.   		{
1353.   		c=ssl_get_cipher_by_char(s,p);

ssl/ssl_lib.c:1351:12: Loop condition is true. Entering loop body
1349.   		}
1350.   
1351.   	for (i=0; i<num; i+=n)
                   ^
1352.   		{
1353.   		c=ssl_get_cipher_by_char(s,p);

ssl/ssl_lib.c:1353:3: Skipping __function_pointer__(): unresolved function pointer
1351.   	for (i=0; i<num; i+=n)
1352.   		{
1353.   		c=ssl_get_cipher_by_char(s,p);
          ^
1354.   		p+=n;
1355.   		if (c != NULL)

ssl/ssl_lib.c:1354:3: 
1352.   		{
1353.   		c=ssl_get_cipher_by_char(s,p);
1354. > 		p+=n;
1355.   		if (c != NULL)
1356.   			{

ssl/ssl_lib.c:1355:7: Taking true branch
1353.   		c=ssl_get_cipher_by_char(s,p);
1354.   		p+=n;
1355.   		if (c != NULL)
              ^
1356.   			{
1357.   			if (!sk_SSL_CIPHER_push(sk,c))

ssl/ssl_lib.c:1357:9: 
1355.   		if (c != NULL)
1356.   			{
1357. > 			if (!sk_SSL_CIPHER_push(sk,c))
1358.   				{
1359.   				SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,ERR_R_MALLOC_FAILURE);

crypto/stack/stack.c:251:1: start of procedure sk_push()
  249.   	}
  250.   
  251. > int sk_push(STACK *st, char *data)
  252.   	{
  253.   	return(sk_insert(st,data,st->num));

crypto/stack/stack.c:253:2: Skipping sk_insert(): empty list of specs
  251.   int sk_push(STACK *st, char *data)
  252.   	{
  253.   	return(sk_insert(st,data,st->num));
          ^
  254.   	}
  255.   
