Fix OOB in hb-shape

This commit is contained in:
Behdad Esfahbod 2012-01-19 12:30:43 -05:00
parent 8d2781d692
commit 27c36af411
1 changed files with 1 additions and 1 deletions

View File

@ -631,7 +631,7 @@ text_options_t::get_line (unsigned int *len)
char buf[BUFSIZ];
while (fgets (buf, sizeof (buf), fp)) {
unsigned int bytes = strlen (buf);
if (buf[bytes - 1] == '\n') {
if (bytes && buf[bytes - 1] == '\n') {
bytes--;
g_string_append_len (gs, buf, bytes);
break;