diff options
author | Mattias Jacobsson <2pi@mok.nu> | 2019-02-07 15:30:22 +0300 |
---|---|---|
committer | Darren Hart (VMware) <dvhart@infradead.org> | 2019-03-07 10:12:34 +0300 |
commit | 841f1b8fb4ca5e296e0ecb2b13f2a679d912ec4d (patch) | |
tree | 4536ed1e2389b5074dc9fb866a339a60184428de /scripts/mod/file2alias.c | |
parent | b98dc493e7e17dbc63f4c3f37040e0175a49bb18 (diff) | |
download | linux-841f1b8fb4ca5e296e0ecb2b13f2a679d912ec4d.tar.xz |
modpost: file2alias: define size of alias
The size of the variable alias provided to do_entry functions are
currently not readily available. Thus hindering do_entry functions to
perform bounds checking.
Define the macro ALIAS_SIZE containing the size of the variable alias.
Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r-- | scripts/mod/file2alias.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index a37af7d71973..afe22af20d7d 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -50,6 +50,9 @@ struct devtable { int (*do_entry)(const char *filename, void *symval, char *alias); }; +/* Size of alias provided to do_entry functions */ +#define ALIAS_SIZE 500 + /* Define a variable f that holds the value of field f of struct devid * based at address m. */ @@ -1303,7 +1306,7 @@ static void do_table(void *symval, unsigned long size, struct module *mod) { unsigned int i; - char alias[500]; + char alias[ALIAS_SIZE]; device_id_check(mod->name, device_id, size, id_size, symval); /* Leave last one: it's the terminator. */ |