【发布时间】:2019-09-25 19:16:36
【问题描述】:
我在修补开源软件易受攻击的问题时遇到了问题,它是在 m4 开源中发现的 CVE-2008-1687。
问题的日志是
cd [build_DIR]/m4/1.4.9-r2/m4-1.4.9/checks && AWK=gawk ./get-them ../doc/m4.texinfo
(....跳过)
节点:评论 gawk:cmd. line:70: (FILENAME=../doc/m4.texinfo FNR=919) 致命:
Invalid content of \{\}: /@tabchar{}/
日志说gawk命令执行到m4.texinfo文件的第918行,在第919行出现Invalid content of \{\}: /@tabchar{}/错误。但是,在m4的第919行找不到\{\}内容和/@tabchar{}/字符。纺织信息。
所以,我想知道为什么会发生错误以及如何解决它。
[得到他们]
/^@example$/, /^@end example$/ {
if (seq < 0)
next;
if ($0 ~ /^@example$/) {
if (count > 0)
close (file);
seq++;
count++;
file = sprintf("%03d.%s", count, node);
printf("dnl @ %s:%d: Origin of test\n"\
"dnl @ expected status: %d\n"\
"dnl @ Copyright (C) 2006, 2007 Free Software Foundation\n"\
"dnl @ This file is free software; the Free Software Foundation\n"\
"dnl @ gives unlimited permission to copy and/or distribute it\n"\
"dnl @ with or without modifications, as long as this notice\n"\
"dnl @ is preserved.\n", FILENAME, NR, status) > file;
status = 0;
next;
}
if ($0 ~ /^@end example$/) {
next; // line 70
}
if ($0 ~ /^\^D$/)
next;
if ($0 ~ '/^@result\{\}/' || $0 ~ '/^@error\{\}/')
prefix = "dnl ";
else
prefix = "";
gsub("@@", "@", $0);
gsub("@{", "{", $0);
gsub("@}", "}", $0);
gsub("@w{ }", " ", $0);
gsub("@tabchar{}", "\t", $0);
printf("%s%s\n", prefix, $0) >> file;
}
[m4.texinfo]
@node 评论 @code{m4} 输入中的@section 注释
@cindex cmets @code{m4} 中的注释通常由字符 @samp{#} 分隔 和换行符。注释分隔符之间的所有字符都被忽略, 但是整个注释(包括分隔符)被传递到 输出---cmets 被@code{m4} 丢弃了@emph{not}。
评论不能嵌套,所以@samp{#} 之后的第一个换行符结束 评论。 begin-comment 字符串的注释效果 可以通过引用来禁止。
@示例
quoted text' #commented text' // 第 919 行@result{}quoted text # `commented text'
quoting inhibits'#' `cmets'@result{}引用禁止 # cmets
@end 示例
【问题讨论】:
-
错误日志是“
\{\} : @tabchar{} (\ is missing.)的内容无效
标签: awk