From 75ef78d83529fbdcd2e2046a7e0caada16667806 Mon Sep 17 00:00:00 2001 From: brong Date: Tue, 19 Mar 2002 00:15:08 +0000 Subject: [PATCH] Protection against non-existant $msort to fix Debian Bug ##127104. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2603 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/read_body.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/read_body.php b/src/read_body.php index 2cddd9df..69b402b3 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -35,6 +35,9 @@ function findNextMessage() { $result = $currentArrayIndex - 1; } } else { + if (!is_array($msort)) { + return -1; + } for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) { if ($currentArrayIndex == $msgs[$key]['ID']) { next($msort); @@ -70,6 +73,9 @@ function findPreviousMessage() { $result = $currentArrayIndex + 1; } } else { + if (!is_array($msort)) { + return -1; + } for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) { if ($currentArrayIndex == $msgs[$key]['ID']) { prev($msort); -- 2.25.1