1 Star 0 Fork 13

starlet_dx/gfs2-utils

forked from src-openEuler/gfs2-utils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-gfs2-edit-always-use-s-style-format-for-printf-style.patch 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
wk333 提交于 2022-04-07 17:22 . fix build error
From 17fb470356a6d55988f05ac70f06b382ef982604 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <[email protected]>
Date: Sun, 7 Nov 2021 09:00:31 +0000
Subject: [PATCH] gfs2/edit: always use "%s"-style format for printf()-style
functions
`ncurses-6.3` added printf-style function attributes and now makes
it easier to catch cases when user input is used in place of format
string when built with CFLAGS=-Werror=format-security:
hexedit.c:227:9: error: format not a string literal and no format arguments [-Werror=format-security]
227 | printw(s2);
| ^~~~~~
Let's wrap all the missing places with "%s" format.
---
gfs2/edit/hexedit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 798639b5..88ee3e5f 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -221,10 +221,10 @@ static void gfs2instr(const char *s1, const char *s2)
{
COLORS_HIGHLIGHT;
move(line,0);
- printw(s1);
+ printw("%s", s1);
COLORS_NORMAL;
move(line,17);
- printw(s2);
+ printw("%s", s2);
line++;
}
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/starlet-dx/gfs2-utils.git
[email protected]:starlet-dx/gfs2-utils.git
starlet-dx
gfs2-utils
gfs2-utils
master

搜索帮助