瀏覽代碼

Check offset

walkor 3 年之前
父節點
當前提交
aa9c58b02e
共有 1 個文件被更改,包括 3 次插入0 次删除
  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;