From fe0f622aefb4f4316d9f6814f4badcda5528eedf Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 11 Jan 2017 04:12:28 +0000 Subject: diff: note the dangers of gigantic anchors hash --- lib/PublicInbox/RepobrowseGitDiffCommon.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/RepobrowseGitDiffCommon.pm b/lib/PublicInbox/RepobrowseGitDiffCommon.pm index ac38aa0a..ae0e6821 100644 --- a/lib/PublicInbox/RepobrowseGitDiffCommon.pm +++ b/lib/PublicInbox/RepobrowseGitDiffCommon.pm @@ -240,6 +240,8 @@ sub git_diff_sed_stat ($$) { $l =~ /\A(\S+)\t+(\S+)\t+(.*)/ or next; my ($add, $del, $fn) = ($1, $2, $3); if ($fn ne '') { # normal modification + # TODO: discard diffs if they are too big + # gigantic changes with many files may still OOM us my $anchor = to_attr(git_unquote($fn)); $req->{anchors}->{$anchor} = $fn; $l = utf8_html($fn); -- cgit v1.2.3-24-ge0c7