Commits
- Commit:
3c662d44f43a51e2e21400eb6bfb6b0c1b11460f
- From:
- Sven M. Hallberg <pesco@khjk.org>
- Date:
make dump
- Commit:
8ef141df421bafd93b75fefaeb236065afe4ee24
- From:
- Sven M. Hallberg <pesco@khjk.org>
- Date:
quick hack to dump /DCTDecode as jpeg files
- Commit:
cd24df616f7e500ccb59ed64cfc36e8f18702fd1
- From:
- pompolic <pompolic@special-circumstanc.es>
- Date:
Merge branch 'fix-assertion-a-used-failed' into 'master'
Fix segfault on dictionaries with odd lengths
See merge request pesco/pdf!16
- Commit:
86fecbce404a9379c4e33837101ba43713fcc9bb
- From:
- pompolic <pompolic@special-circumstanc.es>
- Date:
Merge branch 'fix-aux-xrefs-segfault' into 'master'
Fix segfault when `decode_stream` fails in xrefs
See merge request pesco/pdf!17
- Commit:
27b2ab1324d48686fe455b1c1fe98f8b533a2b8b
- From:
- xentrac <xentrac@special-circumstanc.es>
- Date:
Fix segfault on dictionaries with odd lengths
It’s probably a bug that our dictionary parser is inserting a
key-value “pair” into our dictionary structure which just has a key
but no value, but the proximal cause of the crash was that `dictentry`
is reading off the end of the key-value pair and getting a null
pointer.
This fixes the bug revealed by the instigator in input file
assertion-a-used-failed.
- Commit:
79dc4dd64dee4c459207a6f7c8c1cd18c824fda7
- From:
- pompolic <pompolic@special-circumstanc.es>
- Date:
Merge branch 'fix-decode-assert-fail' into 'master'
Report incorrect /Filter type with decode failure
See merge request pesco/pdf!18
- Commit:
a5abf1e2d9cdc9bbb71f02f8555d2055309541c5
- From:
- xentrac <xentrac@special-circumstanc.es>
- Date:
Fix segfault when `decode_stream` fails in xrefs
In instigator-crashes/aux-xrefs-segfault an invalid flate-encoded stream
was producing this behavior:
inflate: invalid distance too far back (-3)
parse error in stream (XRef)
../instigator-crashes/aux-xrefs-segfault: error parsing xref section at position 249939 (0x3d053)
Program received signal SIGSEGV, Segmentation fault.
0x000055555555d91f in lookup_xref (aux=0x7fffffffdf60, nr=4, gen=0) at pdf.c:1249
1249 HCountedArray *subs = H_INDEX_SEQ(aux->xrefs[i], 0);
What was happening was that `act_ks_value`, indirectly invoked by
`parse_xrefs`, invoked `decode_stream`, which produced the "inflate:"
message and returned NULL; so `act_ks_value` produced the "parse error
in stream" message and returned an HParseResult of that NULL pointer.
Higher up the stack `act_xrstm` packs this NULL pointer into element 0
of a new `h_sequence`. `parse_xrefs` was happily storing this
`h_sequence` into `aux->xrefs[0]`, then blithely continuing to the next
loop iteration, at which point it would report "error parsing xref
section" and return back to main().
However, this did not abort parsing the file! main() was continuing on
to attempt to parse the PDF file as a whole, but the first time the
resulting parse tried to `lookup_xref`, that lookup would attempt to
iterate over the xrefs section in the file, checking to see if the xref
number belonged to any of them. The line of code above then segfaulted
while attempting to assert that the NULL was actually a valid
`h_sequence` pointer.
So this patch simply prevents `parse_xrefs` from treating the failed xrefs
section as valid. The result is that, as before, the parse exits shortly
because it can't follow any xrefs — but now without segfaulting!
inflate: invalid distance too far back (-3)
parse error in stream (XRef)
../instigator-crashes/aux-xrefs-segfault: error parsing xref section at position 255242 (0x3e50a)
VIOLATION[1]@433 (0x1b1): Missing endobj token (severity=1)
../instigator-crashes/aux-xrefs-segfault: no parse
VIOLATION[1]@433 (0x1b1): Missing endobj token (severity=1)
../instigator-crashes/aux-xrefs-segfault: error after position 433 (0x1b1)
[Inferior 1 (process 626584) exited with code 01]
- Commit:
c9ab81f899e5ed4668d95cf5d250364c5ba50922
- From:
- Pompolic <pompolic@special-circumstanc.es>
- Date:
Fix overflow in act_rldstring
- Commit:
7dbed70aae6b21401a7cfcbf4b8e06c119b7d1ca
- From:
- Pompolic <pompolic@special-circumstanc.es>
- Date:
Merge branch 'xentrac/pdf-fix-digit-pair-assert'
- Commit:
4019289144d05b4451919a4a9d450d5e56c810b8
- From:
- xentrac <xentrac@special-circumstanc.es>
- Date:
Fix typo in comment
- Commit:
79160fa1b140b6df0d1f647f5e3e317504df9e92
- From:
- Pompolic <pompolic@special-circumstanc.es>
- Date:
Merge branch 'denleylam/pdf-master'
- Commit:
669790f191189a4e1c9416572909dd3a158547f5
- From:
- xentrac <xentrac@special-circumstanc.es>
- Date:
Report incorrect /Filter type with decode failure
Previously, when the instigator produced a PDF file with a stream with
`<</Filter 718>>` in its stream dictionary, pdf was failing by
aborting with an assert failure. An assert failure is not the right
way to report that the program’s input is invalid. This change simply
returns NULL from `decode_stream` in this case.
- Commit:
44af06e3097b9f4e3a40462daf1facd286f8bef5
- From:
- xentrac <xentrac@special-circumstanc.es>
- Date:
Fix erroneous assert that never worked
This bug was only triggered when a PDF stream used AsciiHexDecode, which
is very unusual, but it would then always be triggered if the stream
contained two or more hex digits.
- Commit:
eb736692df74f6c683d67cf27306c28b5fd10c0d
- From:
- Denley <>
- Date:
Fix uninitialized variable for lzwspec
- Commit:
98671c12c1a5705b2bf20261509a2ed41ac78ea8
- From:
- Sven M. Hallberg <pesco@khjk.org>
- Date:
initialize result variables in act_hdigitpair()
- Commit:
136edb7cbf62a4878345a8f4819240a09679d5f3
- From:
- Sven M. Hallberg <pesco@khjk.org>
- Date:
improve overflow check in act_numb()
- Commit:
4a6cd10658be56430c4801ea6189fdbf2faf222d
- From:
- pompolic <pompolic@special-circumstanc.es>
- Date:
Fix overflow issue
- Commit:
b129f11e497010def47afd2afb4c1602d8b10d01
- From:
- pompolic <pompolic@special-circumstanc.es>
- Date:
Merge branch 'master' into 2020-06-27_RELEASE
- Commit:
db7f494b21976897f7c57eb32d967754609119be
- From:
- pompolic <pompolic@special-circumstanc.es>
- Date:
Revert "Execute tests for should_fail directory"
This reverts commit fa8c763a8ef8d531ce5876e9e44ec11cc9390f58.
- Commit:
dce73cf51984222ec222914b7b456757d700058b
- From:
- Sven M. Hallberg <pesco@khjk.org>
- Date:
better detect missing newline before 'endstream'
- Commit:
fa8c763a8ef8d531ce5876e9e44ec11cc9390f58
- From:
- pompolic <pompolic@special-circumstanc.es>
- Date:
Execute tests for should_fail directory
- Commit:
4738716a9ce539dfc74aaad4fe55b8135c0681b5
- From:
- Sven M. Hallberg <pesco@khjk.org>
- Date:
detect missing linefeed after 'stream' keyword
- Commit:
1e3d951d28498dfc2e076dac91b149d4929d5d2c
- From:
- Pompolic <pompolic@special-circumstanc.es>
- Date:
Move test that's expected to fail
- Commit:
c3bc010b87f4bb42e288a001030b71468e4ea051
- From:
- Sven M. Hallberg <pesco@khjk.org>
- Date:
check for integer overflow
- Commit:
86cc2a8811c0ecaa347a5e512ea99e1bd18bda67
- From:
- Sven M. Hallberg <pesco@khjk.org>
- Date:
ignore but log leading junk bytes