Fix OOB in hb-shape

This commit is contained in:
Behdad Esfahbod committed 2012-01-19 12:30:43 -05:00
1 parent 8d2781d692
commit 27c36af411
1 file changed
+1 -1
+1 -1
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;