diff options
author | Snappy Team <no-reply@google.com> | 2020-11-14 21:55:24 +0000 |
---|---|---|
committer | Victor Costan <costan@google.com> | 2020-11-18 23:21:47 +0000 |
commit | 719bed0ae21071963ab6e8cc09c51e88212cbcb0 (patch) | |
tree | d94cf865f152cd91927b83a9e371ad54e498ab23 | |
parent | 289c8a3c0a06451316da8d5e74daeb972ec69c4d (diff) | |
download | snappy-git-719bed0ae21071963ab6e8cc09c51e88212cbcb0.tar.gz |
Bug fix. Error on 0 offset copies.
PiperOrigin-RevId: 342447553
-rw-r--r-- | snappy.cc | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -892,6 +892,8 @@ std::pair<const uint8_t*, char*> DecompressBranchless( // always succeed for literals. if (SNAPPY_PREDICT_FALSE(offset < len)) { assert(tag_type != 0); + // offset 0 is an error. + if (SNAPPY_PREDICT_FALSE(offset == 0)) break; op = IncrementalCopy(op_base + delta, op_base + op, op_base + op + len, op_base + op_limit) - op_base; |