mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
CVE-2017-8842 Fix divide-by-zero in bufRead::get
This commit is contained in:
parent
74b735ab68
commit
38386bd482
|
|
@ -465,7 +465,8 @@ struct bufRead: public libzpaq::Reader {
|
||||||
|
|
||||||
int get() {
|
int get() {
|
||||||
if (progress && !(*s_len % 128)) {
|
if (progress && !(*s_len % 128)) {
|
||||||
int pct = (total_len - *s_len) * 100 / total_len;
|
int pct = (total_len > 0) ?
|
||||||
|
(total_len - *s_len) * 100 / total_len : 100;
|
||||||
|
|
||||||
if (pct / 10 != *last_pct / 10) {
|
if (pct / 10 != *last_pct / 10) {
|
||||||
int i;
|
int i;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue