test/ssltest_old.c:344: error: NULL_DEREFERENCE
  pointer `server_proto` last assigned on line 333 could be null and is dereferenced by call to `memcmp()` at line 344, column 9.
Showing all 27 steps of the trace


test/ssltest_old.c:328:1: start of procedure verify_alpn()
326.   }
327.   
328. > static int verify_alpn(SSL *client, SSL *server)
329.   {
330.       const unsigned char *client_proto, *server_proto;

test/ssltest_old.c:331:5: 
329.   {
330.       const unsigned char *client_proto, *server_proto;
331. >     unsigned int client_proto_len = 0, server_proto_len = 0;
332.       SSL_get0_alpn_selected(client, &client_proto, &client_proto_len);
333.       SSL_get0_alpn_selected(server, &server_proto, &server_proto_len);

test/ssltest_old.c:332:5: 
330.       const unsigned char *client_proto, *server_proto;
331.       unsigned int client_proto_len = 0, server_proto_len = 0;
332. >     SSL_get0_alpn_selected(client, &client_proto, &client_proto_len);
333.       SSL_get0_alpn_selected(server, &server_proto, &server_proto_len);
334.   

ssl/ssl_lib.c:2884:1: start of procedure SSL_get0_alpn_selected()
  2882.    * respond with a negotiated protocol then |*len| will be zero.
  2883.    */
  2884. > void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data,
  2885.                               unsigned int *len)
  2886.   {

ssl/ssl_lib.c:2887:5: 
  2885.                               unsigned int *len)
  2886.   {
  2887. >     *data = ssl->s3.alpn_selected;
  2888.       if (*data == NULL)
  2889.           *len = 0;

ssl/ssl_lib.c:2888:9: Taking false branch
  2886.   {
  2887.       *data = ssl->s3.alpn_selected;
  2888.       if (*data == NULL)
                  ^
  2889.           *len = 0;
  2890.       else

ssl/ssl_lib.c:2891:9: 
  2889.           *len = 0;
  2890.       else
  2891. >         *len = (unsigned int)ssl->s3.alpn_selected_len;
  2892.   }
  2893.   

ssl/ssl_lib.c:2888:5: 
  2886.   {
  2887.       *data = ssl->s3.alpn_selected;
  2888. >     if (*data == NULL)
  2889.           *len = 0;
  2890.       else

ssl/ssl_lib.c:2892:1: return from a call to SSL_get0_alpn_selected
  2890.       else
  2891.           *len = (unsigned int)ssl->s3.alpn_selected_len;
  2892. > }
  2893.   
  2894.   int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,

test/ssltest_old.c:333:5: 
331.       unsigned int client_proto_len = 0, server_proto_len = 0;
332.       SSL_get0_alpn_selected(client, &client_proto, &client_proto_len);
333. >     SSL_get0_alpn_selected(server, &server_proto, &server_proto_len);
334.   
335.       OPENSSL_free(alpn_selected);

ssl/ssl_lib.c:2884:1: start of procedure SSL_get0_alpn_selected()
  2882.    * respond with a negotiated protocol then |*len| will be zero.
  2883.    */
  2884. > void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data,
  2885.                               unsigned int *len)
  2886.   {

ssl/ssl_lib.c:2887:5: 
  2885.                               unsigned int *len)
  2886.   {
  2887. >     *data = ssl->s3.alpn_selected;
  2888.       if (*data == NULL)
  2889.           *len = 0;

ssl/ssl_lib.c:2888:9: Taking true branch
  2886.   {
  2887.       *data = ssl->s3.alpn_selected;
  2888.       if (*data == NULL)
                  ^
  2889.           *len = 0;
  2890.       else

ssl/ssl_lib.c:2889:9: 
  2887.       *data = ssl->s3.alpn_selected;
  2888.       if (*data == NULL)
  2889. >         *len = 0;
  2890.       else
  2891.           *len = (unsigned int)ssl->s3.alpn_selected_len;

ssl/ssl_lib.c:2888:5: 
  2886.   {
  2887.       *data = ssl->s3.alpn_selected;
  2888. >     if (*data == NULL)
  2889.           *len = 0;
  2890.       else

ssl/ssl_lib.c:2892:1: return from a call to SSL_get0_alpn_selected
  2890.       else
  2891.           *len = (unsigned int)ssl->s3.alpn_selected_len;
  2892. > }
  2893.   
  2894.   int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,

test/ssltest_old.c:335:5: 
333.       SSL_get0_alpn_selected(server, &server_proto, &server_proto_len);
334.   
335. >     OPENSSL_free(alpn_selected);
336.       alpn_selected = NULL;
337.   

crypto/mem.c:295:1: start of procedure CRYPTO_free()
  293.   }
  294.   
  295. > void CRYPTO_free(void *str, const char *file, int line)
  296.   {
  297.       INCREMENT(free_count);

crypto/mem.c:298:9: Taking true branch
  296.   {
  297.       INCREMENT(free_count);
  298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                 ^
  299.           free_impl(str, file, line);
  300.           return;

crypto/mem.c:298:30: Taking true branch
  296.   {
  297.       INCREMENT(free_count);
  298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                      ^
  299.           free_impl(str, file, line);
  300.           return;

crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer
  297.       INCREMENT(free_count);
  298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  299.           free_impl(str, file, line);
                 ^
  300.           return;
  301.       }

crypto/mem.c:300:9: 
  298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  299.           free_impl(str, file, line);
  300. >         return;
  301.       }
  302.   

crypto/mem.c:314:1: return from a call to CRYPTO_free
  312.       free(str);
  313.   #endif
  314. > }
  315.   
  316.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

test/ssltest_old.c:336:5: 
334.   
335.       OPENSSL_free(alpn_selected);
336. >     alpn_selected = NULL;
337.   
338.       if (client_proto_len != server_proto_len) {

test/ssltest_old.c:338:9: Taking false branch
336.       alpn_selected = NULL;
337.   
338.       if (client_proto_len != server_proto_len) {
               ^
339.           BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
340.           goto err;

test/ssltest_old.c:343:9: Taking true branch
341.       }
342.   
343.       if (client_proto != NULL &&
               ^
344.           memcmp(client_proto, server_proto, client_proto_len) != 0) {
345.           BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");

test/ssltest_old.c:344:9: 
342.   
343.       if (client_proto != NULL &&
344. >         memcmp(client_proto, server_proto, client_proto_len) != 0) {
345.           BIO_printf(bio_stdout, "ALPN selected protocols differ!\n");
346.           goto err;
