diff mbox series

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

Message ID 20190512085752.1791-1-tytso@mit.edu
State Accepted, archived
Headers show
Series unicode: add missing check for an error return from utf8lookup() | expand

Commit Message

Theodore Ts'o May 12, 2019, 8:57 a.m. UTC
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Gabriel Krisman Bertazi <krisman@collabora.com>
---
 fs/unicode/utf8-norm.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Gabriel Krisman Bertazi May 12, 2019, 9:18 p.m. UTC | #1
"Theodore Ts'o" <tytso@mit.edu> writes:

> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Cc: Gabriel Krisman Bertazi <krisman@collabora.com>

Acked-by: Gabriel Krisman Bertazi <krisman@collabora.com>

> ---
>  fs/unicode/utf8-norm.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/fs/unicode/utf8-norm.c b/fs/unicode/utf8-norm.c
> index 20d440c3f2db..801ed6d2ea37 100644
> --- a/fs/unicode/utf8-norm.c
> +++ b/fs/unicode/utf8-norm.c
> @@ -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);
>  		}
diff mbox series

Patch

diff --git a/fs/unicode/utf8-norm.c b/fs/unicode/utf8-norm.c
index 20d440c3f2db..801ed6d2ea37 100644
--- a/fs/unicode/utf8-norm.c
+++ b/fs/unicode/utf8-norm.c
@@ -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);
 		}