Skip to contentSkip to conversation

libext2fs: add missing check for utf8lookup()'s return value

PATCH In review Theodore Ts'o 2 participants 2 messages May 10, 2019 – May 12, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libext2fs: add missing check for utf8lookup()'s return value

Fixes-Coverity-Bug: 1442630

Cc Gabriel Krisman Bertazi <[email protected]>
---
 lib/ext2fs/nls_utf8.c | 2 ++
 1 file changed, 2 insertions(+)
lib/ext2fs/nls_utf8.c +2 -0
index 42148099a..e4c4e7a30 100644
@@ -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);
 		}
 
Signature · 1 line
2.19.1