projects
/
tools
/
apitrace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0983c32
)
Fix a nasty crash.
author
Zack Rusin
<zack@kde.org>
Mon, 29 Aug 2011 21:24:44 +0000
(17:24 -0400)
committer
Zack Rusin
<zack@kde.org>
Mon, 29 Aug 2011 21:24:44 +0000
(17:24 -0400)
the size of the compressed buffer can be under certain circumstances
bigger than the size of the input buffer.
trace_snappyfile.cpp
patch
|
blob
|
history
diff --git
a/trace_snappyfile.cpp
b/trace_snappyfile.cpp
index
ad0a577
..
5804c3b
100644
(file)
--- a/
trace_snappyfile.cpp
+++ b/
trace_snappyfile.cpp
@@
-66,7
+66,9
@@
SnappyFile::SnappyFile(const std::string &filename,
m_cachePtr(0),
m_cacheSize(0)
{
- m_compressedCache = new char[SNAPPY_CHUNK_SIZE];
+ size_t maxCompressedLength =
+ snappy::MaxCompressedLength(SNAPPY_CHUNK_SIZE);
+ m_compressedCache = new char[maxCompressedLength];
}
SnappyFile::~SnappyFile()