]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Address infinite loop when processing $GENERATE
authorMark Andrews <marka@isc.org>
Fri, 19 Jan 2024 01:37:10 +0000 (12:37 +1100)
committerMark Andrews <marka@isc.org>
Mon, 6 May 2024 23:19:43 +0000 (09:19 +1000)
In nibble mode if the value to be converted was negative the parser
would loop forever.  Process the value as an unsigned int instead
of as an int to prevent sign extension when shifting.

This was found by Eric Sesterhenn from X41.

lib/dns/master.c

index a9e7960d9633bc5617591b96f0432c91550cf9a9..9f7258b3b32c959348fe41c25cf9b854e21acc3c 100644 (file)
@@ -581,7 +581,8 @@ static const char *hex = "0123456789abcdef0123456789ABCDEF";
  * counting the terminating NUL.
  */
 static unsigned int
-nibbles(char *numbuf, size_t length, unsigned int width, char mode, int value) {
+nibbles(char *numbuf, size_t length, unsigned int width, char mode,
+       unsigned int value) {
        unsigned int count = 0;
 
        /*