You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/12/07 14:46:39 UTC

[httpcomponents-core] branch HTTPCORE-704 created (now 5f1b360)

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a change to branch HTTPCORE-704
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git.


      at 5f1b360  HTTPCORE-704: HPackDecoder fails to correctly decode an empty header if a non-ASCII charset is being used

This branch includes the following new commits:

     new 5f1b360  HTTPCORE-704: HPackDecoder fails to correctly decode an empty header if a non-ASCII charset is being used

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[httpcomponents-core] 01/01: HTTPCORE-704: HPackDecoder fails to correctly decode an empty header if a non-ASCII charset is being used

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch HTTPCORE-704
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit 5f1b3600296b4ec7d7c806453d39a1a70082462b
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Tue Dec 7 15:38:38 2021 +0100

    HTTPCORE-704: HPackDecoder fails to correctly decode an empty header if a non-ASCII charset is being used
---
 .../src/main/java/org/apache/hc/core5/http2/hpack/HPackDecoder.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HPackDecoder.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HPackDecoder.java
index 1df29a2..3f35676 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HPackDecoder.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HPackDecoder.java
@@ -193,6 +193,9 @@ public final class HPackDecoder {
         clearState();
         decodeString(this.contentBuf, src);
         final int binaryLen = this.contentBuf.length();
+        if (binaryLen == 0) {
+            return 0;
+        }
         if (this.charsetDecoder == null) {
             buf.ensureCapacity(binaryLen);
             for (int i = 0; i < binaryLen; i++) {