diff options
author | Yann Collet <cyan@fb.com> | 2018-04-27 16:04:09 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2018-04-27 16:04:09 (GMT) |
commit | d294dd7fc684b1f46130358ff5c218e835082b16 (patch) | |
tree | 42941cf5bbd825ef6617da3925b13bbf13c89a51 /doc/lz4_manual.html | |
parent | 0fb3a3b199ed0a92a402c5979c514a329b85462a (diff) | |
download | lz4-d294dd7fc684b1f46130358ff5c218e835082b16.zip lz4-d294dd7fc684b1f46130358ff5c218e835082b16.tar.gz lz4-d294dd7fc684b1f46130358ff5c218e835082b16.tar.bz2 |
ensure favorDecSpeed is properly initialized
also :
- fix a potential malloc error
- proper use of ALLOC macro inside lz4hc
- update html API doc
Diffstat (limited to 'doc/lz4_manual.html')
-rw-r--r-- | doc/lz4_manual.html | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/doc/lz4_manual.html b/doc/lz4_manual.html index f8639fe..ddd2724 100644 --- a/doc/lz4_manual.html +++ b/doc/lz4_manual.html @@ -126,15 +126,17 @@ int LZ4_compress_fast_extState (void* state, const char* src, char* dst, int src <pre><b>int LZ4_decompress_fast (const char* src, char* dst, int originalSize); </b><p>This function is a bit faster than LZ4_decompress_safe(), -but doesn't provide any security guarantee. +but it may misbehave on malformed input because it doesn't perform full validation of compressed data. originalSize : is the uncompressed size to regenerate Destination buffer must be already allocated, and its size must be >= 'originalSize' bytes. return : number of bytes read from source buffer (== compressed size). If the source stream is detected malformed, the function stops decoding and return a negative result. - note : This function respects memory boundaries for *properly formed* compressed data. - However, it does not provide any protection against malicious input. - It also doesn't know 'src' size, and implies it's >= compressed size. - Use this function in trusted environment **only**. + note : This function is only usable if the originalSize of uncompressed data is known in advance. + The caller should also check that all the compressed input has been consumed properly, + i.e. that the return value matches the size of the buffer with compressed input. + The function never writes past the output buffer. However, since it doesn't know its 'src' size, + it may read past the intended input. Also, because match offsets are not validated during decoding, + reads from 'src' may underflow. Use this function in trusted environment **only**. </p></pre><BR> <pre><b>int LZ4_decompress_safe_partial (const char* src, char* dst, int srcSize, int targetOutputSize, int dstCapacity); |