提交 b6ee30a2 编写于 作者: B Barry Song 提交者: Greg Kroah-Hartman

Staging: iio-utils: fix memory overflow for dynamically allocateded memory to hold filename

Signed-off-by: NBarry Song <21cnbao@gmail.com>
Acked-by: NJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c3dee74f
......@@ -62,9 +62,8 @@ inline int find_type_by_name(const char *name, const char *type)
1) != 0) {
filename = malloc(strlen(iio_dir)
+ strlen(type)
+ 1
+ numstrlen
+ 1);
+ 6);
if (filename == NULL)
return -ENOMEM;
sprintf(filename, "%s%s%d/name",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册