]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1191937: If a bug comment contains a reference to a very large bug ID, the bug...
authorFrédéric Buclin <LpSolit@gmail.com>
Thu, 13 Aug 2015 21:59:02 +0000 (23:59 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Thu, 13 Aug 2015 21:59:02 +0000 (23:59 +0200)
r=gerv a=sgreen

Bugzilla/Bug.pm

index 2cc9aadb0a4e007ac2e1df12ba1373ae3a3a2a53..0ec29623e21f40af4dc648724a41de87b7d00a1e 100644 (file)
@@ -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];
 }