提交 b9c24466 编写于 作者: K Kees Cook 提交者: James Bottomley

[SCSI] esas2r: fix potential format string flaw

This makes sure format strings cannot leak into the printk call via the
constructed buffer.
Signed-off-by: NKees Cook <keescook@chromium.org>
Acked-by: NBradley Grove <bgrove@attotech.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 2e706377
......@@ -165,13 +165,9 @@ static int esas2r_log_master(const long level,
/*
* Put a line break at the end of the formatted string so that
* we don't wind up with run-on messages. only append if there
* is enough space in the buffer.
* we don't wind up with run-on messages.
*/
if (strlen(event_buffer) < buflen)
strcat(buffer, "\n");
printk(event_buffer);
printk("%s\n", event_buffer);
spin_unlock_irqrestore(&event_buffer_lock, flags);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册