Commit Graph

32 Commits

Author SHA1 Message Date
Michael R Sweet
b0e4646f9d
Rework CR/LF skip code to be more consistent. 2023-10-06 14:41:55 -04:00
Michael R Sweet
a83f7f50ff
Allow extra whitespace/newlines after stream tokens (Issue #40) 2023-10-02 05:06:33 -04:00
Michael R Sweet
4f10021e7e
Fix denial-of-service attack when reading corrupt PDF files. 2023-02-03 20:39:04 -05:00
Michael R Sweet
067683cbcd
Add some protection against opening multiple streams in the same file at the same time. 2022-07-04 13:03:11 -04:00
Michael R Sweet
a431d7806f
Fix a few stack/buffer overflow bugs discovered by Bart, Steffan, and Mark from
the Radboud University NL (thanks!)

- Add depth argument to all value read functions that recurse
- Add depth argument to page tree loading code
- Validate xref stream sizes individually to avoid out-of-bounds access to local
  xref buffer.
2021-11-29 17:46:56 -05:00
Michael R Sweet
790cd440ea
Fix up copying objects from unencrypted to AES-encrypted documents (still looks
like there are some issues with strings in dicts)
2021-10-25 21:22:59 -04:00
Michael R Sweet
dd56317635
Need object when reading/writing encrypted PDFs (to decrypt/encrypt strings),
RC4 writing is now working, AES-128 needs work, AES-256 hasn't been done yet.
2021-10-23 18:08:16 -04:00
Michael R Sweet
d6746c08a4
Add pdfioFileCreateOutput API (Issue #21) 2021-09-27 07:41:50 -04:00
Michael R Sweet
6e5cfc1a5f
Make object reader handle object headers that don't conform to any of the PDF
standards.
2021-08-23 19:52:01 -04:00
Michael R Sweet
466cb473d1
Fix _pdfioFileRead/Seek to fix test suite-reported error loading an object. 2021-06-10 10:58:07 -04:00
Michael R Sweet
a698b9c1a2
API cleanup, more work on documentation. 2021-06-07 08:34:30 -04:00
Michael R Sweet
3ec771e688
Add read-back tests. 2021-06-02 15:46:39 -04:00
Michael R Sweet
246c2e4b41
Rename as PDFio for consistency.
Add PDFio logo image.

Move documentation to "doc" subdirectory.
2021-05-30 07:10:44 -04:00
Michael R Sweet
a18b8fd606
Switch to using double for numbers, since they are also used to record lengths
and other potentially large contents.
2021-05-29 21:16:21 -04:00
Michael R Sweet
35d22705fa
Implement pdfioObjCopy and pdfioPageCopy, with tests. 2021-05-29 20:00:48 -04:00
Michael R Sweet
94cb915885
Fix xref table - wrong total number of objects.
Update pdfioContentDrawImage to take x/y offsets and sizes.
2021-05-28 22:05:44 -04:00
Michael R Sweet
548ff7d119
Initial writing support. 2021-05-16 11:39:05 -04:00
Michael R Sweet
4bb81417a8
Start fleshing out writing/copying interfaces. 2021-05-15 09:29:37 -04:00
Michael R Sweet
7cb4d0a557
Update TODOs. 2021-05-10 21:33:26 -04:00
Michael R Sweet
b030c24ba1
Add pdfioObjGetArray. 2021-05-10 21:01:02 -04:00
Michael R Sweet
18853ca3d5
Increase token buffer to 256 bytes, to avoid overflow scenarios.
Add _pdfioTokenFlush to manually flush the token buffer.

Add more debug printfs.
2021-05-10 17:37:57 -04:00
Michael R Sweet
4e4c47ab33
Add pdfioObjGetLength function. 2021-05-08 19:16:27 -04:00
Michael R Sweet
9a919d478f
Rework token reading to be separate from the PDF file so we can add support
for compressed object streams.
2021-05-08 07:38:44 -04:00
Michael R Sweet
44325ce2d9
Safe work on streams - still need to implement predictors 2021-05-07 08:47:49 -04:00
Michael R Sweet
c61d6ad686
Save work on streams. 2021-05-06 16:08:08 -04:00
Michael R Sweet
4abb91ca24
Save work on loading object dictionaries - have a memory issue someplace. 2021-05-04 21:31:58 -04:00
Michael R Sweet
7afdfc725c
Implement object loading. 2021-05-04 17:04:09 -04:00
Michael R Sweet
d13364a4fd
Implement pdfioFileOpen reading of xref table. 2021-05-01 11:41:43 -04:00
Michael R Sweet
e2e2192ea9
Save work. 2021-04-27 21:22:34 -04:00
Michael R Sweet
11588ce2f5
Save work on low-level file I/O. 2021-04-26 10:42:01 -04:00
Michael R Sweet
899feb15c7
Start filling out internal APIs. 2021-04-16 21:09:43 -04:00
Michael R Sweet
c2610f2dd0
Fill out basic API functions. 2021-04-16 20:41:46 -04:00