diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-07-03 16:37:50 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-07-03 16:37:50 +0000 |
commit | dd2516596867cce7586b47406c010d63ba73f289 (patch) | |
tree | 6b243f6f22ef0621524e56cbf94ccc0ae3773cc1 /apps/s_server.c | |
parent | 657e29c1999f02b8962ccbe26faa63cbccb4ff2e (diff) |
Fix memory leak.
Always perform nexproto callback argument initialisation in s_server
otherwise we use uninitialised data if -nocert is specified.
Diffstat (limited to 'apps/s_server.c')
-rw-r--r-- | apps/s_server.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/apps/s_server.c b/apps/s_server.c index 8ea916d6e1..6be2b628a7 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -1518,25 +1518,24 @@ bad: goto end; } } - -# ifndef OPENSSL_NO_NEXTPROTONEG - if (next_proto_neg_in) - { - unsigned short len; - next_proto.data = next_protos_parse(&len, - next_proto_neg_in); - if (next_proto.data == NULL) - goto end; - next_proto.len = len; - } - else - { - next_proto.data = NULL; - } -# endif #endif /* OPENSSL_NO_TLSEXT */ } +#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) + if (next_proto_neg_in) + { + unsigned short len; + next_proto.data = next_protos_parse(&len, next_proto_neg_in); + if (next_proto.data == NULL) + goto end; + next_proto.len = len; + } + else + { + next_proto.data = NULL; + } +#endif + if (s_dcert_file) { |