]> 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:59:06 +0000 (23:59 +0000)
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.

(cherry picked from commit 371824f0789d6e491216f266bf62955a73b49858)

lib/dns/master.c

index c78502272170692cc120b011aeb75159b80c3dfa..eab1d0036452a8474b2dc0869bfb5d65f9a8791b 100644 (file)
@@ -626,7 +626,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;
 
        /*