Fix OOB in hb-shape
This commit is contained in:
parent
8d2781d692
commit
27c36af411
|
@ -631,7 +631,7 @@ text_options_t::get_line (unsigned int *len)
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
while (fgets (buf, sizeof (buf), fp)) {
|
while (fgets (buf, sizeof (buf), fp)) {
|
||||||
unsigned int bytes = strlen (buf);
|
unsigned int bytes = strlen (buf);
|
||||||
if (buf[bytes - 1] == '\n') {
|
if (bytes && buf[bytes - 1] == '\n') {
|
||||||
bytes--;
|
bytes--;
|
||||||
g_string_append_len (gs, buf, bytes);
|
g_string_append_len (gs, buf, bytes);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue