Whamcloud - gitweb
libext2fs: add missing check for utf8lookup()'s return value
authorTheodore Ts'o <tytso@mit.edu>
Fri, 10 May 2019 18:18:12 +0000 (14:18 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 12 May 2019 06:23:01 +0000 (02:23 -0400)
Fixes-Coverity-Bug: 1442630
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
lib/ext2fs/nls_utf8.c

index 4214809..e4c4e7a 100644 (file)
@@ -789,6 +789,8 @@ static int utf8byte(struct utf8cursor *u8c)
                        }
 
                        leaf = utf8lookup(u8c->data, u8c->hangul, u8c->s);
+                       if (!leaf)
+                               return -1;
                        ccc = LEAF_CCC(leaf);
                }