From 48360ec03b225dfec5f90bc5cb93122203d2dd6b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 26 Sep 2013 16:48:42 -0400 Subject: [PATCH] Bug 68990 - test-common fails on i686-linux Fix use-after-end-of-scope. --- src/hb-common.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hb-common.cc b/src/hb-common.cc index 88f7ed1..cf24660 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -292,11 +292,13 @@ retry: hb_language_t hb_language_from_string (const char *str, int len) { + char strbuf[64]; + if (!str || !len || !*str) return HB_LANGUAGE_INVALID; - if (len >= 0) { - char strbuf[64]; + if (len >= 0) + { len = MIN (len, (int) sizeof (strbuf) - 1); str = (char *) memcpy (strbuf, str, len); strbuf[len] = '\0'; -- 2.7.4