https://bugs.gentoo.org/962891 https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgmeqt.git;a=commit;h=150b23c105f3ea7034e6f106e60686aea4e4a13e From 150b23c105f3ea7034e6f106e60686aea4e4a13e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20Kl=C3=B6cker?= Date: Sat, 12 Jul 2025 23:10:10 +0200 Subject: [PATCH] Fix parsing DNs that end with a hex string * src/dn.cpp (parse_dn_part): Handle case that stringv ends with hex string. * tests/t-dn.cpp (TestDistinguishedNameParser::testParser_data): Add test with DN ending with hex string. -- Calling remove_prefix with n > size() (e.g. n == npos) is UB. --- src/dn.cpp | 6 +++++- tests/t-dn.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dn.cpp b/src/dn.cpp index 0a407c9..90632cc 100644 --- a/src/dn.cpp +++ b/src/dn.cpp @@ -219,7 +219,11 @@ static std::pair, std::pair