From: Frédéric Buclin Date: Thu, 13 Aug 2015 21:59:02 +0000 (+0200) Subject: Bug 1191937: If a bug comment contains a reference to a very large bug ID, the bug... X-Git-Tag: release-5.1.1~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ebf35e43c3be63a6ad91239d4dee19ab50e769f;p=thirdparty%2Fbugzilla.git Bug 1191937: If a bug comment contains a reference to a very large bug ID, the bug is no longer viewable with PostgreSQL r=gerv a=sgreen --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 2cc9aadb0a..0ec29623e2 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -533,7 +533,7 @@ sub _preload_referenced_bugs { my $referenced_bugs = Bugzilla::Bug->new_from_list(\@ref_bug_ids); $_->object_cache_set() foreach @$referenced_bugs; - return $referenced_bug_ids + return $referenced_bug_ids; } # Extract bug IDs mentioned in comments. This is much faster than calling quoteUrls(). @@ -566,6 +566,8 @@ sub _extract_bug_ids { # Old duplicate markers push @bug_ids, $text =~ /(?<=^\*\*\*\ This\ bug\ has\ been\ marked\ as\ a\ duplicate\ of\ )(\d+)(?=\ \*\*\*\Z)/; } + # Make sure to filter invalid bug IDs. + @bug_ids = grep { $_ < MAX_INT_32 } @bug_ids; return [uniq @bug_ids]; }