diff mbox series

[FFmpeg-devel,fateserver] Move validation of parsed slot/date into split_header from load_report

Message ID 20210907150105.2690121-1-martin@martin.st
State New
Headers show
Series [FFmpeg-devel,fateserver] Move validation of parsed slot/date into split_header from load_report | expand

Checks

Context Check Description
andriy/configurex86 warning Failed to apply patch
andriy/configureppc warning Failed to apply patch

Commit Message

Martin Storsjö Sept. 7, 2021, 3:01 p.m. UTC
This avoids using tainted data in the call to zcat in the main loop
in index.cgi.

This fixes the report listing for cases with a compile error.
---
 FATE.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Nicolas George Sept. 7, 2021, 3:28 p.m. UTC | #1
Martin Storsjo (12021-09-07):
> This avoids using tainted data in the call to zcat in the main loop
> in index.cgi.
> 
> This fixes the report listing for cases with a compile error.
> ---
>  FATE.pm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

That is even better, thanks. Applied and deployed.

Regards,
Andreas Rheinhardt Sept. 7, 2021, 3:37 p.m. UTC | #2
Nicolas George:
> Martin Storsjo (12021-09-07):
>> This avoids using tainted data in the call to zcat in the main loop
>> in index.cgi.
>>
>> This fixes the report listing for cases with a compile error.
>> ---
>>  FATE.pm | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> That is even better, thanks. Applied and deployed.
> 
> Regards,
> 
It works! Thanks to you and Martin for your efforts in bringing the
fateserver back.

- Andreas
diff mbox series

Patch

diff --git a/FATE.pm b/FATE.pm
index ccb8958..0d4603f 100644
--- a/FATE.pm
+++ b/FATE.pm
@@ -52,6 +52,8 @@  our $gitweb = "http://git.videolan.org/?p=ffmpeg.git";
 sub split_header {
     my @hdr = split /:/, $_[0];
     $hdr[0] eq 'fate' or return undef;
+    ($hdr[2]) = $hdr[2] =~ /^([0-9]{1,80})\z/ or return undef;
+    ($hdr[3]) = $hdr[3] =~ /^([A-Za-z0-9_\-.]{1,80})\z/ or return undef;
     my $parsed = {
         version => $hdr[1],
         date    => $hdr[2],
@@ -147,8 +149,6 @@  sub load_summary {
 
 sub load_report {
     my ($slot, $date) = @_;
-    ($slot) = $slot =~ /^([A-Za-z0-9_\-.]{1,80})\z/ or exit 1;
-    ($date) = $date =~ /^([0-9]{1,80})\z/ or exit 1;
     my $report = "$fatedir/$slot/$date/report.xz";
     my @recs;