Jay Berkenbilt
a44b5a34a0
Pull wmain -> main code from qpdf.cc into QUtil.cc
2020-01-14 11:40:51 -05:00
Jay Berkenbilt
211a7f57be
QUtil::read_lines_from_file: optional EOL preservation
2020-01-13 11:26:18 -05:00
Jay Berkenbilt
9a398504ca
Refactor QUtil::read_lines_from_file
...
This commit adds the preserve_eol flags but doesn't implement EOL
preservation yet.
2020-01-13 09:19:53 -05:00
Jay Berkenbilt
4fa7b1eb60
Add remove_file and rename_file to QUtil
2019-08-31 15:51:04 -04:00
Jay Berkenbilt
1bde5c68a3
Add QUtil::read_file_into_memory
...
This code was essentially duplicated between test_driver and
standalone_fuzz_target_runner.
2019-06-22 10:14:25 -04:00
Jay Berkenbilt
a35d4ce9cc
Fix bounds error in utf16_to_utf8 conversion
2019-06-21 17:40:24 -04:00
Jay Berkenbilt
d71f05ca07
Fix sign and conversion warnings (major)
...
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.
2019-06-21 13:17:21 -04:00
Jay Berkenbilt
42306e2ff8
QUtil: add unsigned int/string functions
2019-06-21 13:17:21 -04:00
Jay Berkenbilt
e87d149918
Add QUtil::possible_repaired_encodings
2019-01-17 11:43:56 -05:00
Jay Berkenbilt
4630377731
Add status-reporting transcoders to QUtil
2019-01-17 11:43:56 -05:00
Jay Berkenbilt
8f389f14c0
QUtil::analyze_encoding
2019-01-17 11:43:56 -05:00
Jay Berkenbilt
6817ca585a
Bidirectional transcoding for win, mac, pdf, utf8, utf16
2019-01-17 11:43:56 -05:00
Jay Berkenbilt
b341d742db
Add WinAnsi and MacRoman encoding
2019-01-05 23:01:44 -05:00
Jay Berkenbilt
3ef1b77304
Refactor QUtil::utf8_to_ascii
2019-01-05 22:59:29 -05:00
Jay Berkenbilt
02281632cc
Add QUtil::utf8_to_ascii
2019-01-03 23:18:13 -05:00
Jay Berkenbilt
b4bdc42b4f
New exception class QPDFSystemError ( fixes #221 )
2018-08-13 20:01:51 -04:00
Jay Berkenbilt
a2f62935b3
Catch exceptions as const references ( fixes #236 )
...
This fix allows qpdf to compile/test cleanly with gcc 8.
2018-08-12 21:57:52 -04:00
Jay Berkenbilt
e44c395c51
QUtil::toUTF16
2018-06-21 15:57:13 -04:00
Jay Berkenbilt
44674a3e58
Label qutil test output
2018-06-21 15:57:13 -04:00
Jay Berkenbilt
3e306ae64c
Add QUtil::hex_decode
2018-01-14 09:04:13 -05:00
Jay Berkenbilt
6d46346eb9
Detect integer overflow/underflow
2017-08-29 12:28:32 -04:00
Jay Berkenbilt
2d5b854468
Allow reading command-line args from files ( fixes #16 )
2017-07-29 22:23:21 -04:00
Jay Berkenbilt
5993c3e83c
Detect input file = output file ( fixes #29 )
2017-07-29 20:58:01 -04:00
Jay Berkenbilt
6067608d93
Remove needless #ifdef _WIN32 from getWhoami
2013-12-16 16:21:28 -05:00
Jay Berkenbilt
ac4deac187
Call QUtil::safe_fopen in place of fopen
...
fopen was previuosly called wrapped by QUtil::fopen_wrapper, but
QUtil::safe_fopen does this itself, which is less cumbersome.
2013-03-05 13:35:46 -05:00
Jay Berkenbilt
a51ae10b8d
Remove all calls to sprintf
2013-03-05 13:35:46 -05:00
Jay Berkenbilt
66c3c8fdf7
Use portable versions of some UNIX-specific calls
...
Remove needless calls to open, close, and fileno; call remove instead
of unlink.
2013-03-05 13:35:46 -05:00
Jay Berkenbilt
6b9297882e
Mark secure CRT warnings with comment
...
Put a specific comment marker next to every piece of code that MSVC
gives warning 4996 for. This warning is generated for calls to
functions that Microsoft considers insecure or deprecated. This
change is in preparation for fixing all these cases even though none
of them are actually incorrect or insecure as used in qpdf. The
comment marker makes them easier to find so they can be fixed in
subsequent commits.
2013-03-05 13:33:32 -05:00
Jay Berkenbilt
8be8277613
Rewrite QUtil::int_to_string and QUtil::double_to_string
...
Make them safer by avoiding any internal limits and replacing sprintf
with std::ostringstream.
2013-03-04 16:45:16 -05:00
Jay Berkenbilt
30027481f7
Remove all old-style casts from C++ code
2013-03-04 16:45:16 -05:00
Jay Berkenbilt
f3d7c26de1
removed qexc; non-compatible ABI change
...
git-svn-id: svn+q:///qpdf/trunk@709 71b93d88-0707-0410-a8cf-f5a4172ac649
2009-09-26 18:36:04 +00:00
Jay Berkenbilt
76bf91765e
missing header files for gcc 4.3
...
git-svn-id: svn+q:///qpdf/trunk@607 71b93d88-0707-0410-a8cf-f5a4172ac649
2008-05-04 16:02:53 +00:00
Jay Berkenbilt
9a0b88bf77
update release date to actual date
...
git-svn-id: svn+q:///qpdf/trunk@599 71b93d88-0707-0410-a8cf-f5a4172ac649
2008-04-29 12:55:25 +00:00