From 283f5d10ce65e0656f98335bd1f2767fba3be6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 2 Sep 2016 13:42:15 +0200 Subject: [PATCH] Fix possible DOS on too big skip value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - loop only as long as long we have data to skip - convert skip parameter to integer Signed-off-by: Michal Čihař --- import.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/import.php b/import.php index 5afdd869b4..fbb6f09dae 100644 --- a/import.php +++ b/import.php @@ -613,8 +613,8 @@ if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE && isset($charset_of_fil // Something to skip? (because timeout has passed) if (! $error && isset($_POST['skip'])) { - $original_skip = $skip = $_POST['skip']; - while ($skip > 0) { + $original_skip = $skip = intval($_POST['skip']); + while ($skip > 0 && ! $finished) { PMA_importGetNextChunk($skip < $read_limit ? $skip : $read_limit); // Disable read progressivity, otherwise we eat all memory! $read_multiply = 1;