Răsfoiți Sursa

Check offset

walkor 3 ani în urmă
părinte
comite
aa9c58b02e
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      src/Protocols/Http/Request.php

+ 3 - 0
src/Protocols/Http/Request.php

@@ -535,6 +535,9 @@ class Request
     {
         $file = [];
         $boundary = "\r\n$boundary";
+        if (\strlen($this->_buffer) < $section_start_offset) {
+            return 0;
+        }
         $section_end_offset = \strpos($this->_buffer, $boundary, $section_start_offset);
         if (!$section_end_offset) {
             return 0;