aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/BufferInputSource.cc
AgeCommit message (Collapse)Author
2022-08-27Remove BufferInputSource::Membersm-holger
2022-07-26Code tidy : replace 0 with nullptr or truem-holger
2022-04-16Use = default and = delete where possible in classesJay Berkenbilt
2022-04-04Programmatically apply new formatting to codeJay Berkenbilt
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
2022-02-08WHITESPACE ONLY -- expand tabs in source codeJay Berkenbilt
This comment expands all tabs using an 8-character tab-width. You should ignore this commit when using git blame or use git blame -w. In the early days, I used to use tabs where possible for indentation, since emacs did this automatically. In recent years, I have switched to only using spaces, which means qpdf source code has been a mixture of spaces and tabs. I have avoided cleaning this up because of not wanting gratuitous whitespaces change to cloud the output of git blame, but I changed my mind after discussing with users who view qpdf source code in editors/IDEs that have other tab widths by default and in light of the fact that I am planning to start applying automatic code formatting soon.
2022-02-04Add a blank line after the first header included in each sourceJay Berkenbilt
2020-10-22Add range_check method to QIntCJay Berkenbilt
2020-10-21Protect numeric conversion against user's locale (fixes #459)Jay Berkenbilt
2020-10-17Replace memchr with manual memory searchJames R. Barlow
On large files with predominantly \n line endings, memchr(..'\r'..) seems to waste a considerable amount of time searching for a line ending candidate that we don't need. On the Adobe PDF Reference Manual 1.7, this commit is 8x faster at QPDF::processMemoryFile().
2019-08-27Fix fuzz issue 15442 (overflow checking in BufferInputSource)Jay Berkenbilt
2019-06-22Convert remaining public classes to use Members patternJay Berkenbilt
Have classes contain only a single private member of type PointerHolder<Members>. This makes it safe to change the structure of the Members class without breaking binary compatibility. Many of the classes already follow this pattern quite successfully. This brings in the rest of the class that are part of the public API.
2019-06-21Fix sign and conversion warnings (major)Jay Berkenbilt
This makes all integer type conversions that have potential data loss explicit with calls that do range checks and raise an exception. After this commit, qpdf builds with no warnings when -Wsign-conversion -Wconversion is used with gcc or clang or when -W3 -Wd4800 is used with MSVC. This significantly reduces the likelihood of potential crashes from bogus integer values. There are some parts of the code that take int when they should take size_t or an offset. Such places would make qpdf not support files with more than 2^31 of something that usually wouldn't be so large. In the event that such a file shows up and is valid, at least qpdf would raise an error in the right spot so the issue could be legitimately addressed rather than failing in some weird way because of a silent overflow condition.
2013-11-29Include <algorithm> for std::min, std::maxJay Berkenbilt
2013-03-04Remove all old-style casts from C++ codeJay Berkenbilt
2012-07-21Implement QPDFObjectHandle::parseJay Berkenbilt
Move object parsing code from QPDF to QPDFObjectHandle and parameterize the parts of it that are specific to a QPDF object. Provide a version that can't handle indirect objects and that can be called on an arbitrary string. A side effect of this change is that the offset used when reporting invalid stream length has changed, but since the new value seems like a better value than the old one, the test suite has been updated rather than making the code backward compatible. This only effects the offset reported for invalid streams that lack /Length or have an invalid /Length key. Updated some test code and exmaples to use QPDFObjectHandle::parse. Supporting changes include adding a BufferInputSource constructor that takes a string.
2012-07-21Refactor: pull *InputSource out of QPDFJay Berkenbilt
InputSource, FileInputSource, and BufferInputSource are now top-level classes instead of privately nested inside QPDF.