Don't Attach Very Small Dictionaries
authorW. Felix Handte <w@felixhandte.com>
Tue, 4 Dec 2018 22:05:11 +0000 (14:05 -0800)
committerW. Felix Handte <w@felixhandte.com>
Tue, 4 Dec 2018 22:05:11 +0000 (14:05 -0800)
commit535636ff5cca702e4b5eb8e602c0ce70bfcde2c1
tree4e9b7978b465df062589f1e1f4167dd9663411d4
parent3a510831c31500e94f9fd732b586ef7b92642d2c
Don't Attach Very Small Dictionaries

Fixes a mismatch in behavior between loading into the context (via
`LZ4_loadDict()`) a very small (<= 4 bytes) non-contiguous dictionary, versus
attaching it with `LZ4_attach_dictionary()`.

Before this patch, this divergence could be reproduced by running

```
make -C tests fuzzer MOREFLAGS="-m32"
tests/fuzzer -v -s1239 -t3146
```

Making sure these two paths behave exactly identically is an easy way to test
the correctness of the attach path, so it's desirable that this remain an
unpolluted, high signal test.
lib/lz4.c