This is an automated email from the ASF dual-hosted git repository.
gancho 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 9a8ecf4 background_fetch heap-buffer-overflow fix
9a8ecf4 is described below
commit 9a8ecf4a17e0c2ed58286198064798820f1a2060
Author: Gancho Tenev <[email protected]>
AuthorDate: Tue Jun 19 13:00:58 2018 -0700
background_fetch heap-buffer-overflow fix
---
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;
}
}