summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Chikunov <vt@altlinux.org>2021-01-06 23:43:41 +0300
committerPanu Matilainen <pmatilai@redhat.com>2021-03-22 12:04:27 +0200
commitef928c4e8fc9e3e9949752623dc773362810716a (patch)
treefe037180af6b06c056f90cf2462d19305390508d
parent184f1eca8b5c20e51b14b3e895b5bf09bfc70562 (diff)
downloadrpm-ef928c4e8fc9e3e9949752623dc773362810716a.tar.gz
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 <vt@altlinux.org> (cherry picked from commit 405fc8998181353bd510864ca251dc233afec276)
-rw-r--r--rpmio/rpmio.c1
1 files changed, 1 insertions, 0 deletions
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