This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/7.1.x by this push:
new 054a208 background_fetch heap-buffer-overflow fix
054a208 is described below
commit 054a208010a3fd6969b4b9575b541f54332f5f84
Author: Gancho Tenev <[email protected]>
AuthorDate: Tue Jun 19 13:00:58 2018 -0700
background_fetch heap-buffer-overflow fix
(cherry picked from commit 9a8ecf4a17e0c2ed58286198064798820f1a2060)
---
plugins/background_fetch/rules.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/background_fetch/rules.cc
b/plugins/background_fetch/rules.cc
index 3e7bfa5..e513424 100644
--- a/plugins/background_fetch/rules.cc
+++ b/plugins/background_fetch/rules.cc
@@ -23,6 +23,7 @@
*/
#include <cstdlib>
+#include <string_view>
#include "configs.h"
#include "rules.h"
@@ -131,7 +132,7 @@ BgFetchRule::check_field_configured(TSHttpTxn txnp) const
TSDebug(PLUGIN_NAME, "invalid field");
} else {
TSDebug(PLUGIN_NAME, "comparing with %s", _value);
- if (nullptr != strstr(val_str, _value)) {
+ if (std::string_view::npos != std::string_view(val_str,
val_len).find(_value)) {
hdr_found = true;
}
}