From d5a3eebe85a00a66247178eb2a5a428a040e7102 Mon Sep 17 00:00:00 2001 From: iliajie Date: Wed, 17 May 2023 11:13:22 +0300 Subject: [PATCH] Fix to read full size of dangerous type --- updown/fetch.cgi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/updown/fetch.cgi b/updown/fetch.cgi index 4e21a69d8..e4e9a4015 100755 --- a/updown/fetch.cgi +++ b/updown/fetch.cgi @@ -84,8 +84,11 @@ if ($ENV{'PATH_INFO'}) { print "Content-length: $st[7]\n"; print "X-Content-Type-Options: nosniff\n"; print "Content-type: $type\n\n"; - while(read(FILE, $buffer, &get_buffer_size_binary())) { - if ($type =~ /text\/html|xml/i) { + my $dtype = $type =~ /text\/html|xml/i; + my $bsize = + $dtype ? $st[7] : &get_buffer_size_binary(); + while(read(FILE, $buffer, $bsize)) { + if ($dtype) { print &filter_javascript($buffer); } else {