From patchwork Tue Sep 7 15:01:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 30062 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4754616iov; Tue, 7 Sep 2021 08:01:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMiija9RQeJGKDusNx7jcOyy5I6Ylo8WJfFrdlQJBZ+e3xsXfZQilYdY9cdw6ibIjwHCWe X-Received: by 2002:a17:906:774f:: with SMTP id o15mr18553789ejn.200.1631026879735; Tue, 07 Sep 2021 08:01:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631026879; cv=none; d=google.com; s=arc-20160816; b=dZnavKoi56vRgPWaDJkpvub+Y5oaNmZh8eWKcnCE1qjX5vmDEhW81Kp1GpeRdAaUmP St6EoYjOJ7hEmg4pt3oYAAGFPui+2PHpLNZZ41KSILT5Q4PAY47uR3ndp1gpxMibKM9F 849tK+xKiY0GLQLjgyo7Tji21Ahn+YWbw2WQP8db40zruiTi3jcuv23lhBIriez1QXAq YTgb1CfYpOQkMMiedoIOwMcLIFGHLDUh6dUrJIuhqbAknz7XJw+4K19ycAwPScxcBLuD E6dhDsPYQP1yA3xMzy22eFoZffrpjW4I/vafesoEA4BPKUNGbW5zLkCXE0OLnLvLX1Pi lJYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=De9GVSiEH8w6YNOFy+COKx46NOmD7hc6xCPWEygl6UA=; b=0TFU0jlvl7x6vHudOMHMffcS6oCr+9f6CsA4xmQdGQZzF33SH371O3rQOYPrkVuS0T 2gsHpWCq8jaXz7Gts0eP44wwY64EGnuGhqPbdrRr4Do33aFFAP1JV4wm7BhI5JbG51Z+ AFKsIm5b15HS80p0ya9+rx3JuQgKykwPkBw0cREwbI8BOGWCpYyVTSfaKJnRSELYtGU7 QSujQYooYIvJ2FaUWnjSlDlx8McALsclaYrOzWTvCQYfnh1SMTgNTjjFmmyTPDf9NvvT 5+cbUb7tY1LFmJQmQflUFPBwg/cmTL0UqAxpVWgQe4PSxcBeM48/lPaBymDxNsGO2NQv 6p0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20150623.gappssmtp.com header.s=20150623 header.b="NXPq/cb8"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y8si10944867edw.176.2021.09.07.08.01.18; Tue, 07 Sep 2021 08:01:19 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20150623.gappssmtp.com header.s=20150623 header.b="NXPq/cb8"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6BD7A68A74F; Tue, 7 Sep 2021 18:01:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8EE0B68A5D9 for ; Tue, 7 Sep 2021 18:01:07 +0300 (EEST) Received: by mail-lf1-f43.google.com with SMTP id e23so6000334lfj.9 for ; Tue, 07 Sep 2021 08:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1A5GNyr5XdsvZGFpi5H1VSO6+Efl+ocrEKgXawAezfY=; b=NXPq/cb8y1LnvtdPhvq8Wu8935PEFuuk8LeS8mz+OkVOl5LfVnX+w4JWHIXyUM3YE5 44CINOQWgYqPhGTo2sMq1ctwX/4aYLuhtm96E81TOwRnvyn19y41ifADwklMnBNDHl0A fDwZseXalTqSCpo7bJwKeOhk/qLa8TZPl2tR1U5KRj02c9UPGhT69/nGFFT2M1NwjI/a nUiK2802Pwqerf54jzaMJcGW1z5tLRn67APAdtihZ+Flhaiuqgkq8QwP0unWSDPvb0DV p5nXkqhASA8TOZShdfEQ4FSwcowcl4ODtewpii2Q+53PhKNnwsrj44VRuTE+yXJInuSJ 11Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1A5GNyr5XdsvZGFpi5H1VSO6+Efl+ocrEKgXawAezfY=; b=t6GwrU4i8X3w6rDVuh14uGHzXZYWj24F5vNQmImdMYPUKhye19u8QwPut7E6AWdU+I CJJIwLhDH6VTpAXvbgfppfxIqaizVJI25xoBeQiTH7kMCMJ2vGnmGWJa6hXjKQybUi2q ZdnevNq4HMQlLix8YeCJnWii3D7Eso8dcUv46T28kPCzasCMrKxtZzoywft+b5zI1FaE qfe+3v6BX8jJZDpLm902rZS2qvEycfpvAj+w+3Y7ic9lVQ5XQ/sfdj9kV+RbF+tS0UJN Tasgy2WjCGR8Fmb5vI4l72agOSJmxPMCkp2VjwkcbZB/TsR2O8RKzFXro1SPN/5yBsDB uSMg== X-Gm-Message-State: AOAM533bT6cvxDfS1BvcJv+wXY+Y6SUGo1QL0d6KHAnwiJUcieyBUEkF cRbMXJ0Md9oS+ORRGW/ThPhPAvP0J3MqghUQ X-Received: by 2002:a05:6512:693:: with SMTP id t19mr12497467lfe.192.1631026866372; Tue, 07 Sep 2021 08:01:06 -0700 (PDT) Received: from localhost.localdomain (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id d4sm817017lfg.243.2021.09.07.08.01.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 08:01:05 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 7 Sep 2021 18:01:05 +0300 Message-Id: <20210907150105.2690121-1-martin@martin.st> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [fateserver PATCH] Move validation of parsed slot/date into split_header from load_report X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: george@nsup.org Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: /1SXQt0A46lY 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(-) 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;