diff -Nru qpdf-11.5.0/debian/changelog qpdf-11.5.0/debian/changelog --- qpdf-11.5.0/debian/changelog 2023-07-09 10:42:20.000000000 -0400 +++ qpdf-11.5.0/debian/changelog 2023-10-19 07:20:25.000000000 -0400 @@ -1,3 +1,16 @@ +qpdf (11.5.0-1ubuntu1) mantic; urgency=medium + + * Fix data loss bug introduced in 11.0.0 and fixed in 11.6.3. The bug + causes the qpdf tokenizer to discard the character after a one-digit + or two-digit quoted octal string. Most writers don't create these, and + they are rare outside of content streams. By default, qpdf doesn't + parse content streams. The most common place for this to occur would + be in a document's /ID string, but in the worst case, this bug could + cause silent damage to some strings in a PDF file's metadata, such as + bookmark names or form field values. + + -- Jay Berkenbilt Thu, 19 Oct 2023 07:20:25 -0400 + qpdf (11.5.0-1) unstable; urgency=medium * New upstream release. diff -Nru qpdf-11.5.0/debian/patches/series qpdf-11.5.0/debian/patches/series --- qpdf-11.5.0/debian/patches/series 2023-07-09 10:42:20.000000000 -0400 +++ qpdf-11.5.0/debian/patches/series 2023-10-19 07:20:25.000000000 -0400 @@ -0,0 +1 @@ +tokenizer-1ecc6bb2 -p1 diff -Nru qpdf-11.5.0/debian/patches/tokenizer-1ecc6bb2 qpdf-11.5.0/debian/patches/tokenizer-1ecc6bb2 --- qpdf-11.5.0/debian/patches/tokenizer-1ecc6bb2 1969-12-31 19:00:00.000000000 -0500 +++ qpdf-11.5.0/debian/patches/tokenizer-1ecc6bb2 2023-10-19 07:20:25.000000000 -0400 @@ -0,0 +1,34 @@ +commit 1ecc6bb29e24a4f89470ff91b2682b46e0576ad4 +Author: Jay Berkenbilt +Date: Sat Oct 14 17:04:58 2023 -0400 + + Don't lose character after \d or \dd parsing string (fixes #1050) + +diff --git a/libqpdf/QPDFTokenizer.cc b/libqpdf/QPDFTokenizer.cc +index d98af8a9..ca09708a 100644 +--- a/libqpdf/QPDFTokenizer.cc ++++ b/libqpdf/QPDFTokenizer.cc +@@ -692,16 +691,21 @@ QPDFTokenizer::inHexstring2nd(char ch) + void + QPDFTokenizer::inCharCode(char ch) + { ++ bool handled = false; + if (('0' <= ch) && (ch <= '7')) { + this->char_code = 8 * this->char_code + (int(ch) - int('0')); + if (++(this->digit_count) < 3) { + return; + } +- // We've accumulated \ddd. PDF Spec says to ignore high-order overflow. ++ handled = true; + } ++ // We've accumulated \ddd or we have \d or \dd followed by other than an octal digit. The PDF ++ // Spec says to ignore high-order overflow. + this->val += char(this->char_code % 256); + this->state = st_in_string; +- return; ++ if (!handled) { ++ inString(ch); ++ } + } + + void