From: Theodore Ts'o Date: Fri, 10 May 2019 18:18:12 +0000 (-0400) Subject: libext2fs: add missing check for utf8lookup()'s return value X-Git-Tag: v1.45.1~5 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=03b04dbca713ae2acf5ffd8d51146dc7eb60ac9a;p=tools%2Fe2fsprogs.git libext2fs: add missing check for utf8lookup()'s return value Fixes-Coverity-Bug: 1442630 Signed-off-by: Theodore Ts'o Reviewed-by: Gabriel Krisman Bertazi --- diff --git a/lib/ext2fs/nls_utf8.c b/lib/ext2fs/nls_utf8.c index 4214809..e4c4e7a 100644 --- a/lib/ext2fs/nls_utf8.c +++ b/lib/ext2fs/nls_utf8.c @@ -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); }