mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
unicode: constify utf8 data table
All users already handle the table as const data. Move the table itself into .rodata to guard against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20240809-unicode-const-v1-1-69968a258092@weissschuh.net Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
This commit is contained in:
parent
17712b7ea0
commit
43bf9d9755
3 changed files with 3 additions and 3 deletions
|
@ -3338,7 +3338,7 @@ static void write_file(void)
|
||||||
}
|
}
|
||||||
fprintf(file, "};\n");
|
fprintf(file, "};\n");
|
||||||
fprintf(file, "\n");
|
fprintf(file, "\n");
|
||||||
fprintf(file, "struct utf8data_table utf8_data_table = {\n");
|
fprintf(file, "const struct utf8data_table utf8_data_table = {\n");
|
||||||
fprintf(file, "\t.utf8agetab = utf8agetab,\n");
|
fprintf(file, "\t.utf8agetab = utf8agetab,\n");
|
||||||
fprintf(file, "\t.utf8agetab_size = ARRAY_SIZE(utf8agetab),\n");
|
fprintf(file, "\t.utf8agetab_size = ARRAY_SIZE(utf8agetab),\n");
|
||||||
fprintf(file, "\n");
|
fprintf(file, "\n");
|
||||||
|
|
|
@ -4107,7 +4107,7 @@ static const unsigned char utf8data[64256] = {
|
||||||
0x81,0x80,0xcf,0x86,0x85,0x84,0xcf,0x86,0xcf,0x06,0x02,0x00,0x00,0x00,0x00,0x00
|
0x81,0x80,0xcf,0x86,0x85,0x84,0xcf,0x86,0xcf,0x06,0x02,0x00,0x00,0x00,0x00,0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
struct utf8data_table utf8_data_table = {
|
const struct utf8data_table utf8_data_table = {
|
||||||
.utf8agetab = utf8agetab,
|
.utf8agetab = utf8agetab,
|
||||||
.utf8agetab_size = ARRAY_SIZE(utf8agetab),
|
.utf8agetab_size = ARRAY_SIZE(utf8agetab),
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,6 @@ struct utf8data_table {
|
||||||
const unsigned char *utf8data;
|
const unsigned char *utf8data;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct utf8data_table utf8_data_table;
|
extern const struct utf8data_table utf8_data_table;
|
||||||
|
|
||||||
#endif /* UTF8NORM_H */
|
#endif /* UTF8NORM_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue