summaryrefslogtreecommitdiffstats
path: root/programs/lz4io.c
diff options
context:
space:
mode:
authorTakayuki MATSUOKA <takayuki.matsuoka@gmail.com>2015-02-12 12:26:32 (GMT)
committerTakayuki MATSUOKA <takayuki.matsuoka@gmail.com>2015-03-02 04:38:29 (GMT)
commitde5c930c901539082c57193b390fa3666a732883 (patch)
treecbfe4614a3ca38d43c2b95373ea4f708604c37de /programs/lz4io.c
parenteed7952101fbb740018cd00d7d2958d192da8344 (diff)
downloadlz4-de5c930c901539082c57193b390fa3666a732883.zip
lz4-de5c930c901539082c57193b390fa3666a732883.tar.gz
lz4-de5c930c901539082c57193b390fa3666a732883.tar.bz2
Fix sentinel size miscalculation
Since is_nul() style wild-comparing stride is U64, we must add sizeof(U64) to the sentinel.
Diffstat (limited to 'programs/lz4io.c')
-rw-r--r--programs/lz4io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c
index 7315d69..03d93af 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -667,7 +667,7 @@ static unsigned long long decodeLZ4S(FILE* finput, FILE* foutput)
inBuffSize = outBuffSize + 4;
inBuff = (char*)malloc(inBuffSize);
#if defined(LZ4IO_ENABLE_SPARSE_FILE)
- outBuff = (char*)malloc(outBuffSize+1);
+ outBuff = (char*)malloc(outBuffSize+sizeof(U64));
outBuff[outBuffSize] = 1; /* sentinel */
#else /* LZ4IO_ENABLE_SPARSE_FILE */
outBuff = (char*)malloc(outBuffSize);