From: Miod Vallat Date: Mon, 2 Dec 2024 15:47:11 +0000 (+0100) Subject: Reject hexadecimal blobs with odd number of characters, fixes #12650. X-Git-Tag: rec-5.2.0-rc1~8^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44d407ce22e9b206c39836ceb2e2e34873daef43;p=thirdparty%2Fpdns.git Reject hexadecimal blobs with odd number of characters, fixes #12650. 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. --- diff --git a/pdns/rcpgenerator.cc b/pdns/rcpgenerator.cc index 3da0baa20e..3258fb4afb 100644 --- a/pdns/rcpgenerator.cc +++ b/pdns/rcpgenerator.cc @@ -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)