代码拉取完成,页面将自动刷新
From 23c169877fda839f0634b2d193eaf26de290f141 Mon Sep 17 00:00:00 2001
From: Bas Zoetekouw <[email protected]>
Date: Thu, 23 Jul 2020 20:39:04 +0200
Subject: [PATCH] workaround false positie in gcc-10 stringop-overflow checks
---
src/utils.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/utils.c b/src/utils.c
index cb2fe76..2e4139c 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -848,10 +848,9 @@ char *
make_tempfile()
{
char *filename;
- size_t len;
/* TODO: fix hardcoded /tmp */
- char tmpfile_template[] = "/tmp/pinfo.XXXXXX";
+ char tmpfile_template[32] = "/tmp/pinfo.XXXXXX";
/* create a tmpfile */
int fd = mkstemp(tmpfile_template);
@@ -864,9 +863,8 @@ make_tempfile()
}
/* allocate a new string and copy the filename there */
- len = strlen(tmpfile_template)+1;
- filename = xmalloc(len+1); /* guarenteerd to be set to \0's */
- strncpy(filename, tmpfile_template, len);
+ filename = xmalloc(33); /* guarenteerd to be set to \0's */
+ strncpy(filename, tmpfile_template, 32);
/* close the file */
close(fd);
--
2.39.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。