diff options
-rw-r--r-- | utf8.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -135,6 +135,8 @@ utf8_from_data(const struct utf8_data *ud, utf8_char *uc) union utf8_map m = { .uc = 0 }; u_int offset; + if (ud->width == 0) + goto fail; if (ud->width != 1 && ud->width != 2) fatalx("invalid UTF-8 width"); if (ud->size == 0) |