diff options
author | H. Peter Anvin <hpa@zytor.com> | 2005-12-29 20:18:19 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2005-12-29 20:18:19 -0800 |
commit | a0f344c66d5b32c2413e12c56cce545c23f4609c (patch) | |
tree | 9ff8f1af89dce11f5b550a04950af0724ba9607d | |
parent | e4d17631688edf2e26c7488c9d36c0e849db813e (diff) | |
download | libucd-a0f344c66d5b32c2413e12c56cce545c23f4609c.tar.gz |
Handle NULL returns from unicode_character_data() (e.g. ENOMEM)
-rw-r--r-- | nametoucs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nametoucs.c b/nametoucs.c index 4a9a414..8185b1a 100644 --- a/nametoucs.c +++ b/nametoucs.c @@ -45,6 +45,9 @@ unicode_character_lookup(const char *name) const struct unicode_character_data *ucd = unicode_character_data(ucs); + if ( !ucd ) + return NULL; + if ( !ucd->name || strcmp(name, ucd->name) ) { unicode_character_put(ucd); errno = EINVAL; |