Commit 12e58f5e authored by jan.koester's avatar jan.koester
Browse files

urgent fix

parent 956e213d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1132,16 +1132,17 @@ const std::vector<char> libhttppp::HttpClient::_h2Request(

        size_t pos = 0;
        while (pos < raw.size()) {
          size_t frame_start = pos; // save position before parsing frame header
          size_t bytes = 0;
          uint64_t frame_type = h3DecodeVarInt(raw.data() + pos, raw.size() - pos, bytes);
          if (bytes == 0) break;
          pos += bytes;
          if (pos >= raw.size()) break;
          if (pos >= raw.size()) { pos = frame_start; break; }

          uint64_t frame_len = h3DecodeVarInt(raw.data() + pos, raw.size() - pos, bytes);
          if (bytes == 0) break;
          if (bytes == 0) { pos = frame_start; break; }
          pos += bytes;
          if (pos + frame_len > raw.size()) break;
          if (pos + frame_len > raw.size()) { pos = frame_start; break; }

          if (frame_type == 0x01) {
            auto decoded = qpack::Decoder::decode(raw.data() + pos, frame_len);