aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
AgeCommit message (Collapse)Author
2017-08-05QUtil::strcasecmpJay Berkenbilt
2017-07-30Include missing header in QPDFTokenizer.cc (fixes #125)Pranjal Bhor
Required for strtol()
2017-07-30Allow reading command-line args from files (fixes #16)Jay Berkenbilt
2017-07-30Detect input file = output file (fixes #29)Jay Berkenbilt
2017-07-30Catch more exceptions while resolving objectsJay Berkenbilt
2017-07-30When recover stream length, indicate the length (fixes #44)Jay Berkenbilt
2017-07-29Add newline-before-endstream option (fixes #103)Jay Berkenbilt
2017-07-29Handle zlib data errors better (fixes #106)Jay Berkenbilt
2017-07-29Better recovery of bad stream start (fixes #104)Jay Berkenbilt
2017-07-29Better handle split content streams (fixes #73)Jay Berkenbilt
When parsing content streams, allow content to be split arbitrarily across stream boundaries.
2017-07-29Fix exception catchJay Berkenbilt
2017-07-29Use 1.2 as the version if we can't read it from the headerJay Berkenbilt
The code was using 1.0, but we use /FlateDecode, which didn't appear until 1.2.
2017-07-29Add option to preserve unreferenced objectsJay Berkenbilt
2017-07-29Explicitly check root dictionary typeJay Berkenbilt
Very badly corrupted files may not have a retrievable root dictionary. Handle that as a special case so that a more helpful error message can be provided.
2017-07-28Add precheck streams capabilityJay Berkenbilt
When requested, QPDFWriter will do more aggress prechecking of streams to make sure it can actually succeed in decoding them before attempting to do so. This will allow preservation of raw data even when the raw data is corrupted relative to the specified filters.
2017-07-28Convert many more errors to warningsJay Berkenbilt
2017-07-28Convert stream filtering errors to warningsJay Berkenbilt
2017-07-28Convert object parsing errors to warningsJay Berkenbilt
QPDFObjectHandle::parseInternal now issues warnings instead of throwing exceptions for all error conditions that it finds (except internal logic errors) and has stronger recovery for things like invalid tokens and malformed dictionaries. This should improve qpdf's ability to recover from a wide range of broken files that currently cause it to fail.
2017-07-27Move lexer helper functions to QUtilJay Berkenbilt
2017-07-27Remove PCRE from QPDFTokenizerJay Berkenbilt
2017-07-26Make windows includes lowercase (fixes #123)slurdge
For cross compiling.
2017-07-26Don't interpret word tokens in content streams (fixes #82)Jay Berkenbilt
2017-07-26Detect recursion loops resolving objects (fixes #51)Jay Berkenbilt
During parsing of an object, sometimes parts of the object have to be resolved. An example is stream lengths. If such an object directly or indirectly points to the object being parsed, it can cause an infinite loop. Guard against all cases of re-entrant resolution of objects.
2017-07-26Handle object ID 0 (fixes #99)Jay Berkenbilt
This is CVE-2017-9208. The QPDF library uses object ID 0 internally as a sentinel to represent a direct object, but prior to this fix, was not blocking handling of 0 0 obj or 0 0 R as a special case. Creating an object in the file with 0 0 obj could cause various infinite loops. The PDF spec doesn't allow for object 0. Having qpdf handle object 0 might be a better fix, but changing all the places in the code that assumes objid == 0 means direct would be risky.
2017-07-26Avoid xref reconstruction infinite loop (fixes #100)Jay Berkenbilt
This is CVE-2017-9209.
2017-07-26Fix infinite loop while reporting an error (fixes #101)Jay Berkenbilt
This is CVE-2017-9210. The description string for an error message included unparsing an object, which is too complex of a thing to try to do while throwing an exception. There was only one example of this in the entire codebase, so it is not a pervasive problem. Fixing this eliminated one class of infinite loop errors.
2016-01-24C++-Builder supports 64 Bit file functionsThorsten Schöning
The 64 Bit file functions are supported by C++-Builder as well and need to be used, else fseek will error out on larger files than 4 GB like used in the large file test.
2015-11-10Prepare 6.0.0 releaserelease-qpdf-6.0.0Jay Berkenbilt
2015-11-10Bump library sonameJay Berkenbilt
Also update maintainer documentation on binary compatibility testing.
2015-11-10Remove some ABI compatibility private methodsJay Berkenbilt
Since we have to bump soname, remove some private methods that were just there for binary compatibility
2015-11-01Prepare 5.2.0 releaserelease-qpdf-5.2.0Jay Berkenbilt
2015-10-31Tolerate some mangled xref tablesJay Berkenbilt
If xref table entries lack the spec-required trailing whitespace or contain a small amount of extra space, handle them anyway.
2015-10-31Remove trailing whitespaceJay Berkenbilt
2015-10-31Bump soname minor revision for ABI additionsJay Berkenbilt
2015-10-31Implement deterministic IDJay Berkenbilt
For non-encrypted files, determinstic ID generation uses file contents instead of timestamp and file name. At a small runtime cost, this enables generation of the same /ID if the same inputs are converted in the same way multiple times.
2015-05-24Prepare 5.1.3 releaserelease-qpdf-5.1.3Jay Berkenbilt
2015-05-24Handle Microsoft crypt provider without prior keysJay Berkenbilt
As reported in issue #40, a call to CryptAcquireContext in SecureRandomDataProvider fails in a fresh windows install prior to any user keys being created in AppData\Roaming\Microsoft\Crypto\RSA. Thanks michalrames.
2015-02-22Detect loops in /Pages structureJay Berkenbilt
Pushing inherited objects to pages and getting all pages were both prone to stack overflow infinite loops if there were loops in the Pages dictionary. There is a general weakness in the code in that any part of the code that traverses the Pages structure would be prone to this and would have to implement its own loop detection. A more robust fix may provide some general method for handling the Pages structure, but it's probably not worth doing. Note: addition of *Internal2 private functions was done rather than changing signatures of existing methods to avoid breaking compatibility.
2015-02-21Avoid buffer overrun copying digestJay Berkenbilt
Converting a password to an encryption key is supposed to copy up to a certain number of bytes from a digest. Make sure never to copy more than the size of the digest.
2015-02-21Avoid resolving arguments to RJay Berkenbilt
When checking two objects preceding R while parsing, ensure that the objects are direct. This avoids stuff like 1 0 obj containing 1 0 R 0 R from causing an infinite loop in object resolution.
2014-12-29Handle page tree node with no /TypeJay Berkenbilt
Original reported here: https://bugs.launchpad.net/ubuntu/+source/qpdf/+bug/1397413 The PDF specification says that the /Type key for nodes in the pages dictionary (both /Page and /Pages) is required, but some PDF files omit them. Use the presence of other keys to determine the type of pages tree node this is if the type key is not found.
2014-11-14Handle pages with no /Contents from getPageContents()Jay Berkenbilt
The spec allows /Contents to be omitted for pages that are blank, but QPDFObjectHandle::getPageContents() was throwing an exception in this case.
2014-06-07Prepare 5.1.2 releaserelease-qpdf-5.1.2Jay Berkenbilt
2014-06-07Handle indirect stream filter/decode parametersJay Berkenbilt
QPDFWriter was trying to make /Filter and /DecodeParms direct in all cases, but there are some cases where /DecodeParms may refer to a stream, which can't be direct. QPDFWriter doesn't actually need /DecodeParms to be direct in that case because it won't be able to filter the stream. Until we can handle this type of stream, just don't make /Filter and /DecodeParms direct if we can't filter the stream anyway. Fixes #34
2014-02-23Fix calculation of xref stream stream columnsJay Berkenbilt
Fix problem: if the last object in the first part of a linearized file had an offset that was below 65536 by less than the size of the hint stream, the xref stream was invalid and the resulting file is not usable.
2014-01-14Prepare 5.1.1 releaserelease-qpdf-5.1.1Jay Berkenbilt
2013-12-26Avoid traversing same object twice when copying objectsJay Berkenbilt
This is a performance fix. The output is unchanged. Fixes #28.
2013-12-17Prepare 5.1.0 releaserelease-qpdf-5.1.0Jay Berkenbilt
2013-12-16Remove needless #ifdef _WIN32 from getWhoamiJay Berkenbilt
2013-12-16Increase random data provider supportJay Berkenbilt
Add a method to get the current random data provider, and document and test the method for resetting it.