代码拉取完成,页面将自动刷新
From ac6b8d8224de140f5a6f2ca66e6ce279604a37e6 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 6 Apr 2024 15:15:04 -0700
Subject: [PATCH] =?UTF-8?q?dd:=20don=E2=80=99t=20trust=20st=5Fsize=20on=20?=
=?UTF-8?q?/proc/files?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* src/dd.c (skip): Don’t trust st_size == 0
---
src/dd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dd.c b/src/dd.c
index b50b841..a582111 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -1813,7 +1813,7 @@ skip (int fdesc, char const *file, intmax_t records, idx_t blocksize,
struct stat st;
if (ifstat (STDIN_FILENO, &st) != 0)
error (EXIT_FAILURE, errno, _("cannot fstat %s"), quoteaf (file));
- if (usable_st_size (&st) && 0 <= input_offset
+ if (usable_st_size (&st) && 0 < st.st_size && 0 <= input_offset
&& st.st_size - input_offset < offset)
{
/* When skipping past EOF, return the number of _full_ blocks
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。