]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
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 42148099ac3d6435a7beaa2350f56942ef811a7c..e4c4e7a30990c47414f390e54363eb008524e05f 100644 (file)
@@ -789,6 +789,8 @@ static int utf8byte(struct utf8cursor *u8c)
                        }
 
                        leaf = utf8lookup(u8c->data, u8c->hangul, u8c->s);
                        }
 
                        leaf = utf8lookup(u8c->data, u8c->hangul, u8c->s);
+                       if (!leaf)
+                               return -1;
                        ccc = LEAF_CCC(leaf);
                }
 
                        ccc = LEAF_CCC(leaf);
                }