Kevin Backhouse
9ff72e5ca5
Make offset=0 the default parameter.
4 years ago
Kevin Backhouse
61a14c45d1
Fix build failure.
4 years ago
Kevin Backhouse
c9d0cf3643
Make fields of DataBuf private.
4 years ago
Rosen Penev
2c57f214c5
clang-tidy: use nullptr
...
Found with modernize-use-nullptr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev
743da1a564
clang-tidy: use C++ casting
...
Found with google-readability-casting
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev
f9d394adf0
clang-tidy: run through performance checks
...
Found with performance*
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev
b8712188bb
clang-tidy: use auto
...
Found with modernize-use-auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev
c73dfa0106
clang-tidy: use uppercase numeric literals
...
Found with readability-uppercase-literal-suffix
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev
1b9b77c51f
clang-tidy: add ending namespace comments
...
Found with google-readability-namespace-comments
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev
8337462032
clang-tidy: use empty() instead of comparing size
...
Found with readability-container-size-empty
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Luis Díaz Más
01a3bc716d
Fix warnings in VS
4 years ago
Luis Díaz Más
de4d43d4d1
Fix warnings EXIV2_TEAM_EXTRA_WARNINGS
...
Most of the warnings fixed were:
- Hiding of local variables
- Hiding of globals
- Useless casts
- Conversions between float/double
4 years ago
Robin Mills
d632988bbd
Massive code prolog cleanup.
4 years ago
Luis Díaz Más
113136e134
Replace DEBUG with EXIV2_DEBUG_MESSAGES
...
Fixes #926
6 years ago
Kevin Backhouse
b35c43e7c2
Remove call to atol, which might read off the end of the buffer. ( #870 )
6 years ago
Kevin Backhouse
43f154f44b
Merge two enforces into one.
6 years ago
Kevin Backhouse
d3e69f6d2c
Add bounds check on allocation size.
6 years ago
Luis Díaz Más
603692a1d8
Copyright to Exiv2 authors
7 years ago
Luis Díaz Más
94375034e6
Fix -Wsign-compare issues
7 years ago
Robin Mills
6d1c318fc6
Fixes in PngChunk::readRawProfile
7 years ago
Luis Díaz Más
f5b40f3e82
Fix more issues in PngChunk::readRawProfile
7 years ago
Luis Díaz Más
847da051c0
Fix bug in PngChunk::readRawProfile
...
- Now it takes into account text.size_ when searching for a newline
char.
7 years ago
Luis Díaz Más
4161099b91
Fix warnings reported by MSVC
7 years ago
Dan Čermák
35b3e596ed
Add overflow & overread checks to PngChunk::parseTXTChunk()
...
This function was creating a lot of new pointers and strings without
properly checking the array bounds. This commit adds several calls
to enforce(), making sure that the pointers stay within bounds.
Strings are now created using the helper function
string_from_unterminated() to prevent overreads in the constructor of
std::string.
This fixes #400
7 years ago
Luis Diaz Mas
1371d677f9
Remove custom messages from enforce(xxx, Exiv2::kerCorruptedMetadata)
7 years ago
Luis Diaz Mas
c0a879aea4
Fix call to std::count, so that we count until the end of the array
7 years ago
Luis Diaz Mas
3ad0050469
Check validity of compressionFlag & compressionMethod
7 years ago
Luis Diaz Mas
2fb00c8a16
Analyze minimum needed number of null separators in PngChunk::parseTXTChunk
...
This commit fixes the heap-buffer-overflow in PngChunk::parseTXTChunk.
According to the specification:
http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html
There must be 2 null separators when we start to analyze the language tag.
7 years ago
Luis Diaz Mas
4922df6018
Replace '\n' by endl that flush content. Useful for debugging
7 years ago
Dan Čermák
751fba8b54
Added dataBuf size check before calling PngChunk::decodeIHDRChunk
...
- cdataBuf must be at least 8 bytes long otherwise decodeIHDRChunk
reads out of bounds
- pngImage::readMetadata now skips png chunks where the offset for
IHDR chunks is invalid
- added assertion into PngChunk::decodeIHDRChunk() to ensure dataBuf
size
7 years ago
Dan Čermák
efe2ccdcb6
Replaced all hardcoded error codes with ker... constants
7 years ago
Dan Čermák
4429b962e1
Fix out of bounds read in src/pngchunk_int.cpp by @brianmay
...
- consider that key is advanced by 8 bytes if stripHeader is true
=> length is reduced by same amount
Fixed by adding offset to the check in the loop
- Rewrote loop so that keysize is checked before the next
iteration (preventing an out of bounds read)
8 years ago
Luis Díaz Más
d3748152a7
add _int suffix to all the internal files
8 years ago