代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/wget 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 6bd74e33d6d0ccc43031405819a6766382823828 Mon Sep 17 00:00:00 2001
From: Tim Rühsen <tim.ruehsen@gmx.de>
Date: Wed, 18 Dec 2019 13:06:46 +0100
Subject: [PATCH] Fix segfault in progress bar in certain locales
* src/progress.c (create_image): Protect memset from negative count
Reported-by: JunDong Xie
---
src/progress.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/progress.c b/src/progress.c
index 80775b0c..63bebab8 100644
--- a/src/progress.c
+++ b/src/progress.c
@@ -1099,8 +1099,11 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done)
/* " 234.56M" */
down_size = human_readable (size, 1000, 2);
cols_diff = PROGRESS_FILESIZE_LEN - count_cols (down_size);
- memset (p, ' ', cols_diff);
- p += cols_diff;
+ if (cols_diff > 0)
+ {
+ memset (p, ' ', cols_diff);
+ p += cols_diff;
+ }
p += sprintf (p, "%s", down_size);
/* " 12.52Kb/s or 12.52KB/s" */
@@ -1182,8 +1185,11 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done)
else
ncols += sprintf (p + nbytes, "%ss", print_decimal (dl_total_time));
p += ncols + bytes_cols_diff;
- memset (p, ' ', PROGRESS_ETA_LEN - ncols);
- p += PROGRESS_ETA_LEN - ncols;
+ if (ncols < PROGRESS_ETA_LEN)
+ {
+ memset (p, ' ', PROGRESS_ETA_LEN - ncols);
+ p += PROGRESS_ETA_LEN - ncols;
+ }
}
padding = bp->width - count_cols (bp->buffer);
--
2.19.1.windows.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。