trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bc...@apache.org
Subject [trafficserver] 02/02: preventing crashing when calling TSSslContextFindByName with a nullptr or a 0 lenght string
Date Tue, 12 Feb 2019 00:09:38 GMT
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 45efe1a494b0257319af0c3d30098963f4139c5e
Author: Daniel Morilha (netlify) <daniel.morilha@netlify.com>
AuthorDate: Wed Oct 24 14:12:21 2018 -0700

    preventing crashing when calling TSSslContextFindByName with a nullptr or a 0 lenght string
    
    (cherry picked from commit ac61c354acd75cf5ba653c6921c6415d78074134)
---
 src/traffic_server/InkAPI.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 95fa642..1933917 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -9163,6 +9163,10 @@ TSVConnSSLConnectionGet(TSVConn sslp)
 tsapi TSSslContext
 TSSslContextFindByName(const char *name)
 {
+  if (nullptr == name || 0 == strlen(name)) {
+    // an empty name is an invalid input
+    return nullptr;
+  }
   TSSslContext ret      = nullptr;
   SSLCertLookup *lookup = SSLCertificateConfig::acquire();
   if (lookup != nullptr) {


Mime
View raw message