add patch avoid-panic-during-forced-reboot-due-to-aborted-journal
[ext4-patch-queue.git] / unicode-add-missing-utf8lookup-check
blob9a9ac067f405a4614e5417e9842b1d5ec8ad45c0
1 unicode: add missing check for an error return from utf8lookup()
3 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 Cc: Gabriel Krisman Bertazi <krisman@collabora.com>
5 ---
6  fs/unicode/utf8-norm.c | 2 ++
7  1 file changed, 2 insertions(+)
9 diff --git a/fs/unicode/utf8-norm.c b/fs/unicode/utf8-norm.c
10 index 20d440c3f2db..801ed6d2ea37 100644
11 --- a/fs/unicode/utf8-norm.c
12 +++ b/fs/unicode/utf8-norm.c
13 @@ -714,6 +714,8 @@ int utf8byte(struct utf8cursor *u8c)
14                         }
16                         leaf = utf8lookup(u8c->data, u8c->hangul, u8c->s);
17 +                       if (!leaf)
18 +                               return -1;
19                         ccc = LEAF_CCC(leaf);
20                 }