提交 6c23d77f 编写于 作者: J Jacob Champion 提交者: Xin Zhang

add_assignment: don't crash if assignment isn't found

add_assignment previously didn't handle the case where an existing
config assignment was not found, and segfaulted. Fix that by inserting
brand-new assignments at the end of the config list.
上级 4df139b1
......@@ -385,6 +385,12 @@ add_assignment(char **lines, const char *varname, const char *fmt, ...)
iinsert = isrc;
}
if (iinsert < 0)
{
/* No assignment found? Insert at the end. */
iinsert = isrc;
}
/* Build assignment. */
va_start(args, fmt);
if (superseded)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册