From 81c203c910f0bcf880fff0f900001d9f6d5a710b Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Wed, 15 Feb 2012 21:23:15 -0700 Subject: [PATCH] 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. --- src/ssl/ErrorDetailManager.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.47.2