From: Alex Rousskov Date: Thu, 16 Feb 2012 04:23:15 +0000 (-0700) Subject: Bug 3324: loadFromFile: parse error while reading template file X-Git-Tag: BumpSslServerFirst.take05~12^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81c203c910f0bcf880fff0f900001d9f6d5a710b;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);