From 98406c0f56d0e6369138814350bc25d14ff43ff0 Mon Sep 17 00:00:00 2001 From: otto Date: Sun, 16 Apr 2017 06:26:55 +0000 Subject: [PATCH] backout previous, data_len is not always initialized --- lib/libssl/ssl_asn1.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/libssl/ssl_asn1.c b/lib/libssl/ssl_asn1.c index 8e6528d1530..b27be00abea 100644 --- a/lib/libssl/ssl_asn1.c +++ b/lib/libssl/ssl_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_asn1.c,v 1.52 2017/04/14 15:20:16 jsing Exp $ */ +/* $OpenBSD: ssl_asn1.c,v 1.53 2017/04/16 06:26:55 otto Exp $ */ /* * Copyright (c) 2016 Joel Sing @@ -205,9 +205,12 @@ i2d_SSL_SESSION(SSL_SESSION *s, unsigned char **pp) rv = (int)data_len; err: + if (data != NULL) + explicit_bzero(data, data_len); + CBB_cleanup(&session); - freezero(data, data_len); free(peer_cert_bytes); + free(data); return rv; } -- 2.20.1