]> git.ipfire.org Git - thirdparty/zstd.git/commit
[programs] Fix infinite loop when empty input is passed to trainer 3081/head
authorNick Terrell <terrelln@fb.com>
Wed, 2 Mar 2022 19:04:04 +0000 (11:04 -0800)
committerNick Terrell <terrelln@fb.com>
Wed, 2 Mar 2022 19:05:26 +0000 (11:05 -0800)
commitda737c7ab89f61f1ea7c392299137f6ffe6f9733
treeb7e52a8f3a65fac573dcfac661ed9e1657bc64cc
parent87406b5f3b2e6527e626831142a8f99514e7f53d
[programs] Fix infinite loop when empty input is passed to trainer

When an empty input file was passed to the dictionary trainer, it would infinite loop.
The added test case exposes the bug, and is fixed with this PR.
programs/dibio.c
tests/cli-tests/dict-builder/empty-input.sh [new file with mode: 0755]
tests/cli-tests/dict-builder/empty-input.sh.stderr.exact [new file with mode: 0644]