Skip to contentSkip to conversation

unicode: add missing check for an error return from utf8lookup()

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 unicode: add missing check for an error return from utf8lookup()

Cc Gabriel Krisman Bertazi <[email protected]>
---
 fs/unicode/utf8-norm.c | 2 ++
 1 file changed, 2 insertions(+)
fs/unicode/utf8-norm.c +2 -0
index 20d440c3f2db..801ed6d2ea37 100644
@@ -714,6 +714,8 @@ 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
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Theodore Ts'o
Cc Gabriel Krisman Bertazi <[email protected]>
Quoted 16 lines
---
 fs/unicode/utf8-norm.c | 2 ++
 1 file changed, 2 insertions(+)
fs/unicode/utf8-norm.c +2 -0
index 20d440c3f2db..801ed6d2ea37 100644
@@ -714,6 +714,8 @@ int utf8byte(struct utf8cursor *u8c)
 			}
 
 			leaf = utf8lookup(u8c->data, u8c->hangul, u8c->s);
+			if (!leaf)
+				return -1;
 			ccc = LEAF_CCC(leaf);
 		}
Signature · 1 line
Gabriel Krisman Bertazi