This is an automated email from the ASF dual-hosted git repository.

paziz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 5526cb2  coverity 1382799, 1382796: Unchecked return value
5526cb2 is described below

commit 5526cb26ca6611ec072e4f9934153756ab0a35d1
Author: Bryan Call <bc...@apache.org>
AuthorDate: Wed Nov 22 09:49:52 2017 -0800

    coverity 1382799, 1382796: Unchecked return value
---
 iocore/net/SSLSNIConfig.cc | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/iocore/net/SSLSNIConfig.cc b/iocore/net/SSLSNIConfig.cc
index 3b812de..9efde0b 100644
--- a/iocore/net/SSLSNIConfig.cc
+++ b/iocore/net/SSLSNIConfig.cc
@@ -128,10 +128,26 @@ int
 SNIConfigParams::Initialize()
 {
   sni_filename = 
ats_stringdup(RecConfigReadConfigPath("proxy.config.ssl.servername.filename"));
+  struct stat sbuf;
+  if (stat(sni_filename, &sbuf) == -1 && errno == ENOENT) {
+    Warning("Loading SNI configuration - filename: %s doesn't exist", 
sni_filename);
+    return 1;
+  }
+
   lua_State *L = lua_open(); /* opens Lua */
   luaL_openlibs(L);
-  luaL_loadfile(L, sni_filename);
-  lua_pcall(L, 0, 0, 0);
+  if (luaL_loadfile(L, sni_filename)) {
+    Error("Loading SNI configuration - luaL_loadfile: %s", lua_tostring(L, 
-1));
+    lua_pop(L, 1);
+    return 1;
+  }
+
+  if (lua_pcall(L, 0, 0, 0)) {
+    Error("Loading SNI configuration - luap_pcall: %s failed: %s", 
sni_filename, lua_tostring(L, -1));
+    lua_pop(L, 1);
+    return 1;
+  }
+
   L_sni.loader(L);
   loadSNIConfig();
   return 0;

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Reply via email to