File 0677-inet_res-fix-label-compression-encoder-for-large-res.patch of Package erlang

From fc48515df428c27cc0efe5bc2d1956099139d04b Mon Sep 17 00:00:00 2001
From: Alexander Clouter <alex@digriz.org.uk>
Date: Tue, 5 Jan 2021 13:24:24 +0000
Subject: [PATCH 1/2] inet_res: fix label compression encoder for large
 responses

The pointer in the label is only 14bit wide and a typo incorrectly uses the
0b11 (3) flag meaning the limit of 49152 is used instead of 16384.
---
 lib/kernel/src/inet_dns.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/kernel/src/inet_dns.erl b/lib/kernel/src/inet_dns.erl
index e03f124fe6..18103771dc 100644
--- a/lib/kernel/src/inet_dns.erl
+++ b/lib/kernel/src/inet_dns.erl
@@ -697,7 +697,7 @@ encode_labels(Bin, Comp0, Pos, [L|Ls]=Labels)
   when 1 =< byte_size(L), byte_size(L) =< 63 ->
     case gb_trees:lookup(Labels, Comp0) of
 	none ->
-	    Comp = if Pos < (3 bsl 14) ->
+	    Comp = if Pos < (1 bsl 14) ->
 			   %% Just in case - compression
 			   %% pointers can not reach further
 			   gb_trees:insert(Labels, Pos, Comp0);
-- 
2.26.2

openSUSE Build Service is sponsored by