From 10134b5ae1d4a4a23e66d336c97d414ed1f64c95 Mon Sep 17 00:00:00 2001 From: inoguchi Date: Fri, 28 Jan 2022 13:11:56 +0000 Subject: [PATCH] Error check for sk_push in libssl CID 24838 comment and ok tb@ --- lib/libssl/d1_srtp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/libssl/d1_srtp.c b/lib/libssl/d1_srtp.c index 70f9453f5f8..793fa868d77 100644 --- a/lib/libssl/d1_srtp.c +++ b/lib/libssl/d1_srtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_srtp.c,v 1.29 2021/06/11 15:28:13 landry Exp $ */ +/* $OpenBSD: d1_srtp.c,v 1.30 2022/01/28 13:11:56 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -204,7 +204,10 @@ ssl_ctx_make_profiles(const char *profiles_string, if (!srtp_find_profile_by_name(ptr, &p, col ? col - ptr : (int)strlen(ptr))) { - sk_SRTP_PROTECTION_PROFILE_push(profiles, p); + if (!sk_SRTP_PROTECTION_PROFILE_push(profiles, p)) { + sk_SRTP_PROTECTION_PROFILE_free(profiles); + return 1; + } } else { SSLerrorx(SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE); sk_SRTP_PROTECTION_PROFILE_free(profiles); -- 2.20.1