From: Alex Rousskov Date: Sat, 25 Feb 2012 04:27:06 +0000 (-0700) Subject: Bug 3324: loadFromFile: parse error while reading template file X-Git-Tag: SQUID_3_2_0_16~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a967f909c582c663040c3e921295445cc8cc96c;p=thirdparty%2Fsquid.git Bug 3324: loadFromFile: parse error while reading template file Do not store and later use a pointer to a temporary String buffer. HttpHeader::getByName() returns a temporary String. --- diff --git a/src/ssl/ErrorDetailManager.cc b/src/ssl/ErrorDetailManager.cc index 30a23e6eed..40dd926fbd 100644 --- a/src/ssl/ErrorDetailManager.cc +++ b/src/ssl/ErrorDetailManager.cc @@ -209,14 +209,14 @@ Ssl::ErrorDetailFile::parse(const char *buffer, int len, bool eof) return false; } - const char *errorName = parser.getByName("name").termedBuf(); - if (!errorName) { + const String errorName = parser.getByName("name"); + if (!errorName.size()) { debugs(83, DBG_IMPORTANT, HERE << "WARNING! invalid or no error detail name on:" << s); return false; } - Ssl::ssl_error_t ssl_error = Ssl::GetErrorCode(errorName); + Ssl::ssl_error_t ssl_error = Ssl::GetErrorCode(errorName.termedBuf()); if (ssl_error == SSL_ERROR_NONE) { debugs(83, DBG_IMPORTANT, HERE << "WARNING! invalid error detail name: " << errorName);