Skip to content

Commit f515d7a

Browse files
rniwabriannafan
andauthored
[Static analysis] Encodes a filename before inserting it into a URL. (#120123)
This fixes a bug where report links generated from files such as StylePrimitiveNumericTypes+Conversions.h in WebKit result in an error. Co-authored-by: Brianna Fan <[email protected]>
1 parent 4a7673d commit f515d7a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/tools/scan-build/bin/scan-build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use Term::ANSIColor qw(:constants);
2323
use Cwd qw/ getcwd abs_path /;
2424
use Sys::Hostname;
2525
use Hash::Util qw(lock_keys);
26+
use URI::Escape;
2627

2728
my $Prog = "scan-build";
2829
my $BuildName;
@@ -820,7 +821,8 @@ ENDTEXT
820821
}
821822

822823
# Emit the "View" link.
823-
print OUT "<td><a href=\"$ReportFile#EndPath\">View Report</a></td>";
824+
my $EncodedReport = uri_escape($ReportFile, "^A-Za-z0-9\-\._~\/");
825+
print OUT "<td><a href=\"$EncodedReport#EndPath\">View Report</a></td>";
824826

825827
# Emit REPORTBUG markers.
826828
print OUT "\n<!-- REPORTBUG id=\"$ReportFile\" -->\n";

0 commit comments

Comments
 (0)