aboutsummaryrefslogtreecommitdiff
path: root/bbot/worker.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bbot/worker.cxx')
-rw-r--r--bbot/worker.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/bbot/worker.cxx b/bbot/worker.cxx
index a0e2ad7..81d9a50 100644
--- a/bbot/worker.cxx
+++ b/bbot/worker.cxx
@@ -116,7 +116,13 @@ run_bpkg (tracer& t,
{
for (const auto& re: warn_detect)
{
- if (regex_search (l, re))
+ // Only examine the first 512 bytes. Long lines (e.g., linker
+ // command lines) could trigger implementation-specific limitations
+ // (like stack overflow). Plus, it is a performance concern.
+ //
+ if (regex_search (l.begin (),
+ l.size () < 512 ? l.end () : l.begin () + 512,
+ re))
{
r = result_status::warning;
break;