2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-10 15:20:54 +00:00

Fix bug in QPDF_Name::normalizeName introduced in #891

'#' was omitted from the list of chars that need to be escaped.
This commit is contained in:
m-holger 2023-04-04 15:54:54 +01:00
parent 230f1ab290
commit 3f2ebf334b
3 changed files with 5 additions and 3 deletions

View File

@ -38,9 +38,9 @@ QPDF_Name::normalizeName(std::string const& name)
// invalid #. // invalid #.
result += "#"; result += "#";
} else if ( } else if (
ch < 33 || ch == '/' || ch == '(' || ch == ')' || ch == '{' || ch < 33 || ch == '#' || ch == '/' || ch == '(' || ch == ')' ||
ch == '}' || ch == '<' || ch == '>' || ch == '[' || ch == ']' || ch == '{' || ch == '}' || ch == '<' || ch == '>' || ch == '[' ||
ch == '%' || ch > 126) { ch == ']' || ch == '%' || ch > 126) {
result += QUtil::hex_encode_char(ch); result += QUtil::hex_encode_char(ch);
} else { } else {
result += ch; result += ch;

View File

@ -81,6 +81,7 @@ trailer <<
/a#b [ 4 /##00## /Som#ething ] /a#b [ 4 /##00## /Som#ething ]
/Som#ething (else) /Som#ething (else)
>> >>
/#20#23#2f#28#29#7b#7d#3c#3e#5b#5d#25#21#7e#7f 42
>> >>
startxref startxref

View File

@ -92,6 +92,7 @@ xref
0000000629 00000 n 0000000629 00000 n
0000000774 00000 n 0000000774 00000 n
trailer << trailer <<
/#20#23#2f#28#29#7b#7d#3c#3e#5b#5d#25!~#7f 42
/Other#20Tests << /Other#20Tests <<
/## 1 /## 1
/#20# 2 /#20# 2