[Git][java-team/netty][master] Fix for older junit

Bastien Roucariès (@rouca) gitlab at salsa.debian.org
Sat Feb 7 10:59:00 GMT 2026



Bastien Roucariès pushed to branch master at Debian Java Maintainers / netty


Commits:
9511efde by Bastien Roucariès at 2026-02-06T13:30:41+01:00
Fix for older junit

- - - - -


1 changed file:

- debian/patches/CVE-2025-67735.patch


Changes:

=====================================
debian/patches/CVE-2025-67735.patch
=====================================
@@ -44,11 +44,11 @@ origin: backport, https://github.com/netty/netty/commit/77e81f1e5944d98b3acf887d
  .../io/netty/handler/codec/http/HttpUtilTest.java  | 26 ++++++++
  6 files changed, 179 insertions(+), 6 deletions(-)
 
-diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/DefaultFullHttpRequest.java b/codec-http/src/main/java/io/netty/handler/codec/http/DefaultFullHttpRequest.java
-index 117e6db..d599241 100644
---- a/codec-http/src/main/java/io/netty/handler/codec/http/DefaultFullHttpRequest.java
-+++ b/codec-http/src/main/java/io/netty/handler/codec/http/DefaultFullHttpRequest.java
-@@ -53,7 +53,15 @@ public class DefaultFullHttpRequest extends DefaultHttpRequest implements FullHt
+Index: netty-4.1.48/codec-http/src/main/java/io/netty/handler/codec/http/DefaultFullHttpRequest.java
+===================================================================
+--- netty-4.1.48.orig/codec-http/src/main/java/io/netty/handler/codec/http/DefaultFullHttpRequest.java	2026-02-06 14:13:52.992108928 +0530
++++ netty-4.1.48/codec-http/src/main/java/io/netty/handler/codec/http/DefaultFullHttpRequest.java	2026-02-06 14:13:52.990108910 +0530
+@@ -53,7 +53,15 @@
  
      public DefaultFullHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri,
              ByteBuf content, HttpHeaders headers, HttpHeaders trailingHeader) {
@@ -65,11 +65,11 @@ index 117e6db..d599241 100644
          this.content = checkNotNull(content, "content");
          this.trailingHeader = checkNotNull(trailingHeader, "trailingHeader");
      }
-diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpRequest.java b/codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpRequest.java
-index dbc7dd3..d0df1c0 100644
---- a/codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpRequest.java
-+++ b/codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpRequest.java
-@@ -61,9 +61,25 @@ public class DefaultHttpRequest extends DefaultHttpMessage implements HttpReques
+Index: netty-4.1.48/codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpRequest.java
+===================================================================
+--- netty-4.1.48.orig/codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpRequest.java	2026-02-06 14:13:52.992108928 +0530
++++ netty-4.1.48/codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpRequest.java	2026-02-06 14:13:52.990108910 +0530
+@@ -61,9 +61,25 @@
       * @param headers           the Headers for this Request
       */
      public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, HttpHeaders headers) {
@@ -95,11 +95,11 @@ index dbc7dd3..d0df1c0 100644
      }
  
      @Override
-diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java
-index afa3ec4..512d841 100644
---- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java
-+++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java
-@@ -41,12 +41,13 @@ public final class HttpUtil {
+Index: netty-4.1.48/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java
+===================================================================
+--- netty-4.1.48.orig/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java	2026-02-06 14:13:52.992108928 +0530
++++ netty-4.1.48/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java	2026-02-06 14:13:52.990108910 +0530
+@@ -41,12 +41,13 @@
      private static final AsciiString CHARSET_EQUALS = AsciiString.of(HttpHeaderValues.CHARSET + "=");
      private static final AsciiString SEMICOLON = AsciiString.cached(";");
      private static final String COMMA_STRING = String.valueOf(COMMA);
@@ -114,7 +114,7 @@ index afa3ec4..512d841 100644
       */
      public static boolean isOriginForm(URI uri) {
          return uri.getScheme() == null && uri.getSchemeSpecificPart() == null &&
-@@ -54,8 +55,8 @@ public final class HttpUtil {
+@@ -54,8 +55,8 @@
      }
  
      /**
@@ -125,7 +125,7 @@ index afa3ec4..512d841 100644
       */
      public static boolean isAsteriskForm(URI uri) {
          return "*".equals(uri.getPath()) &&
-@@ -475,6 +476,56 @@ public final class HttpUtil {
+@@ -475,6 +476,56 @@
          return null;
      }
  
@@ -182,98 +182,111 @@ index afa3ec4..512d841 100644
      /**
       * Fetch MIME type part from message's Content-Type header as a char sequence.
       *
-diff --git a/codec-http/src/test/java/io/netty/handler/codec/http/DefaultHttpRequestTest.java b/codec-http/src/test/java/io/netty/handler/codec/http/DefaultHttpRequestTest.java
-index cf0fa92..cd15472 100644
---- a/codec-http/src/test/java/io/netty/handler/codec/http/DefaultHttpRequestTest.java
-+++ b/codec-http/src/test/java/io/netty/handler/codec/http/DefaultHttpRequestTest.java
-@@ -21,8 +21,82 @@ import org.junit.Test;
- import static io.netty.handler.codec.http.HttpHeadersTestUtils.of;
+Index: netty-4.1.48/codec-http/src/test/java/io/netty/handler/codec/http/DefaultHttpRequestTest.java
+===================================================================
+--- netty-4.1.48.orig/codec-http/src/test/java/io/netty/handler/codec/http/DefaultHttpRequestTest.java	2026-02-06 14:13:52.992108928 +0530
++++ netty-4.1.48/codec-http/src/test/java/io/netty/handler/codec/http/DefaultHttpRequestTest.java	2026-02-06 14:13:52.990108910 +0530
+@@ -22,8 +22,94 @@
  import static org.junit.Assert.assertNull;
  import static org.junit.Assert.assertTrue;
-+import static org.junit.Assert.assertThrows;
  
- public class DefaultHttpRequestTest {
-+    @ParameterizedTest
-+    @ValueSource(strings = {
-+            "http://localhost/\r\n",
-+            "/r\r\n?q=1",
-+            "http://localhost/\r\n?q=1",
-+            "/r\r\n/?q=1",
-+            "http://localhost/\r\n/?q=1",
-+            "/r\r\n",
-+            "http://localhost/ HTTP/1.1\r\n\r\nPOST /p HTTP/1.1\r\n\r\n",
-+            "/r HTTP/1.1\r\n\r\nPOST /p HTTP/1.1\r\n\r\n",
-+            "/ path",
-+            "/path ",
-+            " /path",
-+            "http://localhost/ ",
-+            " http://localhost/",
-+            "http://local host/",
-+    })
-+    void constructorMustRejectIllegalUrisByDefault(String uri) {
-+        assertThrows(IllegalArgumentException.class, () ->
-+                new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri));
-+    }
+-public class DefaultHttpRequestTest {
++import org.junit.runner.RunWith;
++import org.junit.runners.Parameterized;
++import org.junit.runners.Parameterized.Parameters;
++
++import java.util.Arrays;
++import java.util.Collection;
 +
-+    @ParameterizedTest
-+    @ValueSource(strings = {
-+            "GET ",
-+            " GET",
-+            "G ET",
-+            " GET ",
-+            "GET\r",
-+            "GET\n",
-+            "GET\r\n",
-+            "GE\rT",
-+            "GE\nT",
-+            "GE\r\nT",
-+            "\rGET",
-+            "\nGET",
-+            "\r\nGET",
-+            " \r\nGET",
-+            "\r \nGET",
-+            "\r\n GET",
-+            "\r\nGET ",
-+            "\nGET ",
-+            "\rGET ",
-+            "\r GET",
-+            " \rGET",
-+            "\nGET ",
-+            "\n GET",
-+            " \nGET",
-+            "GET \n",
-+            "GET \r",
-+            " GET\r",
-+            " GET\r",
-+            "GET \n",
-+            " GET\n",
-+            " GET\n",
-+            "GE\nT ",
-+            "GE\rT ",
-+            " GE\rT",
-+            " GE\rT",
-+            "GE\nT ",
-+            " GE\nT",
-+            " GE\nT",
-+    })
-+    void constructorMustRejectIllegalHttpMethodByDefault(String method) {
-+        assertThrows(IllegalArgumentException.class, () -> {
++import static org.junit.Assert.fail;
++
++ at RunWith(Parameterized.class)
++class DefaultHttpRequestIllegalMethodTest {
++    
++    private final String method;
++    
++    public DefaultHttpRequestIllegalMethodTest(String method) {
++        this.method = method;
++    }
++    
++    @Parameters(name = "{index}: method={0}")
++    public static Collection<Object[]> data() {
++        return Arrays.asList(new Object[][] {
++            {"GET "}, {" GET"}, {"G ET"}, {" GET "}, {"GET\r"}, {"GET\n"},
++            {"GET\r\n"}, {"GE\rT"}, {"GE\nT"}, {"GE\r\nT"}, {"\rGET"},
++            {"\nGET"}, {"\r\nGET"}, {" \r\nGET"}, {"\r \nGET"}, {"\r\n GET"},
++            {"\r\nGET "}, {"\nGET "}, {"\rGET "}, {"\r GET"}, {" \rGET"},
++            {"\nGET "}, {"\n GET"}, {" \nGET"}, {"GET \n"}, {"GET \r"},
++            {" GET\r"}, {" GET\r"}, {"GET \n"}, {" GET\n"}, {" GET\n"},
++            {"GE\nT "}, {"GE\rT "}, {" GE\rT"}, {" GE\rT"}, {"GE\nT "},
++            {" GE\nT"}, {" GE\nT"}
++        });
++    }
++    
++    @Test
++    public void constructorMustRejectIllegalHttpMethodByDefault() {
++        try {
 +            new DefaultHttpRequest(HttpVersion.HTTP_1_0, new HttpMethod("GET") {
-+                @Override
 +                public AsciiString asciiName() {
 +                    return new AsciiString(method);
 +                }
 +            }, "/");
++            fail("Expected IllegalArgumentException for method: " + method);
++        } catch (IllegalArgumentException e) {
++            // Expected exception
++        }
++    }
++}
++
++ at RunWith(Parameterized.class)
++class DefaultHttpRequestIllegalUriTest {
++    
++    private final String uri;
++    
++    public DefaultHttpRequestIllegalUriTest(String uri) {
++        this.uri = uri;
++    }
++    
++    @Parameters(name = "{index}: uri={0}")
++    public static Collection<Object[]> data() {
++        return Arrays.asList(new Object[][] {
++            {"http://localhost/\r\n"},
++            {"/r\r\n?q=1"},
++            {"http://localhost/\r\n?q=1"},
++            {"/r\r\n/?q=1"},
++            {"http://localhost/\r\n/?q=1"},
++            {"/r\r\n"},
++            {"http://localhost/ HTTP/1.1\r\n\r\nPOST /p HTTP/1.1\r\n\r\n"},
++            {"/r HTTP/1.1\r\n\r\nPOST /p HTTP/1.1\r\n\r\n"},
++            {"/ path"},
++            {"/path "},
++            {" /path"},
++            {"http://localhost/ "},
++            {" http://localhost/"},
++            {"http://local host/"}
 +        });
 +    }
++    
++    @Test
++    public void constructorMustRejectIllegalUrisByDefault() {
++        try {
++            new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri);
++            fail("Expected IllegalArgumentException for URI: " + uri);
++        } catch (IllegalArgumentException e) {
++            // Expected exception
++        }
++    }
++}
  
++public class DefaultHttpRequestTest {
      @Test
      public void testHeaderRemoval() {
-diff --git a/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestEncoderTest.java b/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestEncoderTest.java
-index 2f866f7..7008b4b 100644
---- a/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestEncoderTest.java
-+++ b/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestEncoderTest.java
-@@ -32,8 +32,6 @@ import static org.hamcrest.Matchers.instanceOf;
+         HttpMessage m = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/");
+Index: netty-4.1.48/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestEncoderTest.java
+===================================================================
+--- netty-4.1.48.orig/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestEncoderTest.java	2026-02-06 14:13:52.992108928 +0530
++++ netty-4.1.48/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestEncoderTest.java	2026-02-06 14:13:52.990108910 +0530
+@@ -32,8 +32,6 @@
  import static org.hamcrest.Matchers.is;
  import static org.junit.Assert.*;
  
@@ -282,47 +295,95 @@ index 2f866f7..7008b4b 100644
  public class HttpRequestEncoderTest {
  
      @SuppressWarnings("deprecation")
-diff --git a/codec-http/src/test/java/io/netty/handler/codec/http/HttpUtilTest.java b/codec-http/src/test/java/io/netty/handler/codec/http/HttpUtilTest.java
-index 186b498..87268c6 100644
---- a/codec-http/src/test/java/io/netty/handler/codec/http/HttpUtilTest.java
-+++ b/codec-http/src/test/java/io/netty/handler/codec/http/HttpUtilTest.java
-@@ -59,6 +59,12 @@ public class HttpUtilTest {
-         assertEquals("2", values.get(1));
-     }
+Index: netty-4.1.48/codec-http/src/test/java/io/netty/handler/codec/http/HttpUtilTest.java
+===================================================================
+--- netty-4.1.48.orig/codec-http/src/test/java/io/netty/handler/codec/http/HttpUtilTest.java	2026-02-06 14:13:52.992108928 +0530
++++ netty-4.1.48/codec-http/src/test/java/io/netty/handler/codec/http/HttpUtilTest.java	2026-02-06 14:31:20.030613329 +0530
+@@ -15,17 +15,22 @@
+  */
+ package io.netty.handler.codec.http;
  
++import io.netty.util.CharsetUtil;
++import io.netty.util.ReferenceCountUtil;
++import io.netty.handler.codec.http.HttpHeaders;
+ import java.net.InetAddress;
+ import java.net.InetSocketAddress;
++import java.net.URI;
+ import java.nio.charset.StandardCharsets;
+ import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.Collection;
+ import java.util.Collections;
+ import java.util.List;
+-
+-import io.netty.util.CharsetUtil;
+-import io.netty.util.ReferenceCountUtil;
++import org.junit.runner.RunWith;
++import org.junit.runners.Parameterized;
++import org.junit.runners.Parameterized.Parameters;
+ import org.junit.Test;
+-
+ import static io.netty.handler.codec.http.HttpHeadersTestUtils.of;
+ import static org.junit.Assert.assertEquals;
+ import static org.junit.Assert.assertFalse;
+@@ -33,6 +38,41 @@
+ import static org.junit.Assert.assertTrue;
+ import static org.junit.Assert.fail;
+ 
++ at RunWith(Parameterized.class)
++class HttpUtilRequestLineTokenValidationTest {
++    
++    private final String token;
++    
++    public HttpUtilRequestLineTokenValidationTest(String token) {
++        this.token = token;
++    }
++    
++    @Parameters(name = "{index}: token={0}")
++    public static Collection<Object[]> data() {
++        return Arrays.asList(new Object[][] {
++            {"http://localhost/\r\n"},
++            {"/r\r\n?q=1"},
++            {"http://localhost/\r\n?q=1"},
++            {"/r\r\n/?q=1"},
++            {"http://localhost/\r\n/?q=1"},
++            {"/r\r\n"},
++            {"http://localhost/ HTTP/1.1\r\n\r\nPOST /p HTTP/1.1\r\n\r\n"},
++            {"/r HTTP/1.1\r\n\r\nPOST /p HTTP/1.1\r\n\r\n"},
++            {"GET "},
++            {" GET"},
++            {"HTTP/ 1.1"},
++            {"HTTP/\r0.9"},
++            {"HTTP/\n1.1"}
++        });
++    }
++    
 +    @Test
++    public void requestLineTokenValidationMustRejectInvalidTokens() throws Exception {
++        assertFalse(HttpUtil.isEncodingSafeStartLineToken(token));
++    }
++}
++
++
+ public class HttpUtilTest {
+ 
+     @Test
+@@ -60,6 +100,18 @@
+     }
+ 
+     @Test
 +    public void testRecognizesAsteriskForm() {
 +        // Asterisk form: https://tools.ietf.org/html/rfc7230#section-5.3.4
 +        assertTrue(HttpUtil.isAsteriskForm(URI.create("*")));
 +        // Origin form: https://tools.ietf.org/html/rfc7230#section-5.3.1
++        assertFalse(HttpUtil.isAsteriskForm(URI.create("/where?q=now")));
++        // Absolute form: https://tools.ietf.org/html/rfc7230#section-5.3.2
++        assertFalse(HttpUtil.isAsteriskForm(URI.create("http://www.example.org/pub/WWW/TheProject.html")));
++        // Authority form: https://tools.ietf.org/html/rfc7230#section-5.3.3
++        assertFalse(HttpUtil.isAsteriskForm(URI.create("www.example.com:80")));
++    }
 +
-     @Test
++    @Test
      public void testGetCharsetAsRawCharSequence() {
          String QUOTES_CHARSET_CONTENT_TYPE = "text/html; charset=\"utf8\"";
-@@ -74,6 +80,26 @@ public class HttpUtilTest {
-         assertNull(HttpUtil.getCharsetAsSequence(SIMPLE_CONTENT_TYPE));
-     }
- 
-+    @ParameterizedTest
-+    @ValueSource(strings = {
-+            "http://localhost/\r\n",
-+            "/r\r\n?q=1",
-+            "http://localhost/\r\n?q=1",
-+            "/r\r\n/?q=1",
-+            "http://localhost/\r\n/?q=1",
-+            "/r\r\n",
-+            "http://localhost/ HTTP/1.1\r\n\r\nPOST /p HTTP/1.1\r\n\r\n",
-+            "/r HTTP/1.1\r\n\r\nPOST /p HTTP/1.1\r\n\r\n",
-+            "GET ",
-+            " GET",
-+            "HTTP/ 1.1",
-+            "HTTP/\r0.9",
-+            "HTTP/\n1.1",
-+    })
-+    public void requestLineTokenValidationMustRejectInvalidTokens(String token) throws Exception {
-+        assertFalse(HttpUtil.isEncodingSafeStartLineToken(token));
-+    }
-+
-     @Test
-     public void testGetCharset() {
-         String NORMAL_CONTENT_TYPE = "text/html; charset=utf-8";
+         String SIMPLE_CONTENT_TYPE = "text/html";



View it on GitLab: https://salsa.debian.org/java-team/netty/-/commit/9511efde7b297f9d0c763ff599fed74d4ba67f5d

-- 
View it on GitLab: https://salsa.debian.org/java-team/netty/-/commit/9511efde7b297f9d0c763ff599fed74d4ba67f5d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20260207/8b2f8774/attachment.htm>


More information about the pkg-java-commits mailing list