2019-05-10 18:24:36

by Theodore Ts'o

[permalink] [raw]
Subject: [PATCH] libext2fs: add missing check for utf8lookup()'s return value

Fixes-Coverity-Bug: 1442630
Signed-off-by: Theodore Ts'o <[email protected]>
Cc: Gabriel Krisman Bertazi <[email protected]>
---
lib/ext2fs/nls_utf8.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/lib/ext2fs/nls_utf8.c b/lib/ext2fs/nls_utf8.c
index 42148099a..e4c4e7a30 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);
}

--
2.19.1


2019-05-12 02:39:15

by Gabriel Krisman Bertazi

[permalink] [raw]
Subject: Re: [PATCH] libext2fs: add missing check for utf8lookup()'s return value

"Theodore Ts'o" <[email protected]> writes:

> Fixes-Coverity-Bug: 1442630
> Signed-off-by: Theodore Ts'o <[email protected]>
> Cc: Gabriel Krisman Bertazi <[email protected]>
> ---
> lib/ext2fs/nls_utf8.c | 2 ++
> 1 file changed, 2 insertions(+)

Reviewed-by: Gabriel Krisman Bertazi <[email protected]>

We should get this applied on the kernel side as well.

Thanks,


--
Gabriel Krisman Bertazi