From ef928c4e8fc9e3e9949752623dc773362810716a Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Wed, 6 Jan 2021 23:43:41 +0300 Subject: rpmio: Fix lzopen_internal mode parsing when 'Tn' is used When there is number after "T" (suggested number of threads or "0" for getncpus), lzopen_internal() mode parser would skip one byte, and when it's at the end of the string it would then parse undesired garbage from the memory, making intermittent compression failures. Fixes: 7740d1098 ("Add support for multithreaded xz compression") Signed-off-by: Vitaly Chikunov (cherry picked from commit 405fc8998181353bd510864ca251dc233afec276) --- rpmio/rpmio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 853897093..52be6a38d 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -774,6 +774,7 @@ static LZFILE *lzopen_internal(const char *mode, int fd, int xz) * should've processed * */ while (isdigit(*++mode)); + --mode; } #ifdef HAVE_LZMA_MT else -- cgit v1.2.1