]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Handle large query IDs in xfer/ans5 properly 12097/head
authorŠtěpán Balážik <stepan@isc.org>
Tue, 26 May 2026 12:57:47 +0000 (14:57 +0200)
committerŠtěpán Balážik <stepan@isc.org>
Tue, 26 May 2026 13:48:26 +0000 (13:48 +0000)
Previously, the server would crash if it received a query with an ID
close to 65535 in the badmessageid case, as adding 50 to it would not
fit in uint16.

This was an oversight in porting it from Perl to Python in
f9ed3650acdc2c5b38d8b36729b045ca63f983ef.

bin/tests/system/xfer/ans5/ans.py

index d26fb926a88e1ec73b0770576f33038cb9c03daa..22a74b2ca8146d68c8bc2c71db2ead57d46ffa58 100644 (file)
@@ -154,7 +154,7 @@ class Add50ToMessageIdFromSecondResponse(ResponseHandlerWrapper):
             assert isinstance(
                 response_action, DnsResponseSend
             ), "Add50ToMessageIdFromSecondResponse can only wrap handlers that yield DnsResponseSend from the second response onward"
-            response_action.response.id += 50
+            response_action.response.id = (response_action.response.id + 50) % 65536
         else:
             self._first_yielded = True