ssl/ssltest.c:455: error: NULL_DEREFERENCE
  pointer `alpn_selected` last assigned on line 454 could be null and is dereferenced by call to `memcpy()` at line 455, column 5.
Showing all 11 steps of the trace


ssl/ssltest.c:429:1: start of procedure cb_server_alpn()
427.   }
428.   
429. > static int cb_server_alpn(SSL *s, const unsigned char **out,
430.                             unsigned char *outlen, const unsigned char *in,
431.                             unsigned int inlen, void *arg)

ssl/ssltest.c:436:5: Skipping next_protos_parse(): empty list of specs
434.       unsigned short protos_len;
435.   
436.       protos = next_protos_parse(&protos_len, alpn_server);
           ^
437.       if (protos == NULL) {
438.           fprintf(stderr, "failed to parser ALPN server protocol string: %s\n",

ssl/ssltest.c:437:9: Taking false branch
435.   
436.       protos = next_protos_parse(&protos_len, alpn_server);
437.       if (protos == NULL) {
               ^
438.           fprintf(stderr, "failed to parser ALPN server protocol string: %s\n",
439.                   alpn_server);

ssl/ssltest.c:443:9: Taking false branch
441.       }
442.   
443.       if (SSL_select_next_proto
               ^
444.           ((unsigned char **)out, outlen, protos, protos_len, in,
445.            inlen) != OPENSSL_NPN_NEGOTIATED) {

ssl/ssltest.c:454:5: 
452.        * verify_alpn.
453.        */
454. >     alpn_selected = OPENSSL_malloc(*outlen);
455.       memcpy(alpn_selected, *out, *outlen);
456.       *out = alpn_selected;

crypto/mem.c:327:1: start of procedure CRYPTO_malloc()
  325.   }
  326.   
  327. > void *CRYPTO_malloc(int num, const char *file, int line)
  328.   {
  329.       void *ret = NULL;

crypto/mem.c:329:5: 
  327.   void *CRYPTO_malloc(int num, const char *file, int line)
  328.   {
  329. >     void *ret = NULL;
  330.   
  331.       if (num <= 0)

crypto/mem.c:331:9: Taking true branch
  329.       void *ret = NULL;
  330.   
  331.       if (num <= 0)
                 ^
  332.           return NULL;
  333.   

crypto/mem.c:332:9: 
  330.   
  331.       if (num <= 0)
  332. >         return NULL;
  333.   
  334.       if (allow_customize)

crypto/mem.c:361:1: return from a call to CRYPTO_malloc
  359.   
  360.       return ret;
  361. > }
  362.   
  363.   char *CRYPTO_strdup(const char *str, const char *file, int line)

ssl/ssltest.c:455:5: 
453.        */
454.       alpn_selected = OPENSSL_malloc(*outlen);
455. >     memcpy(alpn_selected, *out, *outlen);
456.       *out = alpn_selected;
457.   
