]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Reject hexadecimal blobs with odd number of characters, fixes #12650.
authorMiod Vallat <miod.vallat@open-xchange.com>
Mon, 2 Dec 2024 15:47:11 +0000 (16:47 +0100)
committerMiod Vallat <miod.vallat@open-xchange.com>
Mon, 2 Dec 2024 15:47:11 +0000 (16:47 +0100)
Changes in 4e75f84ac9a0ad451d096d8c9cad58fd3b5574dd to allow ignoring
non-hexa characters (such as whitespace) have also allowed dangling
hex digits, which were then padded with an implicit 0. This restores
the original behaviour of throwing an exception for these inputs.

pdns/rcpgenerator.cc

index 3da0baa20e407384b9c3dfe93ec4842ab4293e56..3258fb4afb407713ad7e8bd7530110be1c01846e 100644 (file)
@@ -546,8 +546,7 @@ static void HEXDecode(const char* begin, const char* end, string& out)
     }
   }
   if(mode)
-    out.append(1, (char) val);
-
+    throw RecordTextException("Hexadecimal blob with odd number of characters");
 }
 
 void RecordTextReader::xfrHexBlob(string& val, bool keepReading)