commit | 27c36af411c7c4d75dd25d79fc76dd92c6bb9643 | [log] [tgz] |
---|---|---|
author | Behdad Esfahbod <behdad@behdad.org> | Thu Jan 19 12:30:43 2012 -0500 |
committer | Behdad Esfahbod <behdad@behdad.org> | Thu Jan 19 12:30:43 2012 -0500 |
tree | 13f0c2386d91a7bd5751050b5fcc3cdb31bcc58e | |
parent | 8d2781d69274672303e30522e222bd01c6b5e781 [diff] [blame] |
Fix OOB in hb-shape
diff --git a/util/options.cc b/util/options.cc index 5ded644..6585eb4 100644 --- a/util/options.cc +++ b/util/options.cc
@@ -631,7 +631,7 @@ 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;