提交 b66c874f 编写于 作者: B Boqun Feng 提交者: Miguel Ojeda

kallsyms: use `ARRAY_SIZE` instead of hardcoded size

This removes one place where the `500` constant is hardcoded.
Reviewed-by: NKees Cook <keescook@chromium.org>
Reviewed-by: NGeert Stappers <stappers@stappers.nl>
Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NBoqun Feng <boqun.feng@gmail.com>
Co-developed-by: NMiguel Ojeda <ojeda@kernel.org>
Signed-off-by: NMiguel Ojeda <ojeda@kernel.org>
上级 f76349cf
......@@ -206,7 +206,7 @@ static struct sym_entry *read_symbol(FILE *in)
rc = fscanf(in, "%llx %c %499s\n", &addr, &type, name);
if (rc != 3) {
if (rc != EOF && fgets(name, 500, in) == NULL)
if (rc != EOF && fgets(name, ARRAY_SIZE(name), in) == NULL)
fprintf(stderr, "Read error or end of file.\n");
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册