Procházet zdrojové kódy

Protection against non-existant $msort to fix Debian Bug ##127104.

Bron Gondwana před 23 roky
rodič
revize
3f90cb6969
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      src/read_body.php

+ 6 - 0
src/read_body.php

@@ -35,6 +35,9 @@ function findNextMessage() {
             $result = $currentArrayIndex - 1;
             $result = $currentArrayIndex - 1;
         }
         }
     } else {
     } else {
+        if (!is_array($msort)) {
+            return -1;
+        }
         for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
         for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
             if ($currentArrayIndex == $msgs[$key]['ID']) {
             if ($currentArrayIndex == $msgs[$key]['ID']) {
                 next($msort);
                 next($msort);
@@ -70,6 +73,9 @@ function findPreviousMessage() {
             $result = $currentArrayIndex + 1;
             $result = $currentArrayIndex + 1;
         }
         }
     } else {
     } else {
+	if (!is_array($msort)) {
+            return -1;
+	}
         for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
         for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
             if ($currentArrayIndex == $msgs[$key]['ID']) {
             if ($currentArrayIndex == $msgs[$key]['ID']) {
                 prev($msort);
                 prev($msort);