From 484ee55ab8029a563e371ff316e973406695f081 Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Wed, 6 Jan 2021 23:43:41 +0300 Subject: [PATCH] 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 --- rpmio/rpmio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 9f4a60aa15..2b8ff60318 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -798,6 +798,7 @@ static LZFILE *lzopen_internal(const char *mode, int fd, int xz) * should've processed * */ while (isdigit(*++mode)); + --mode; } #ifdef HAVE_LZMA_MT else