[epiphany] profile-migrator: Check limit before dereferencing



commit ab33eebfb271b64b9bf87419df6b4475571d50d6
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sun Jul 2 11:59:31 2017 -0500

    profile-migrator: Check limit before dereferencing
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783788

 src/profile-migrator/ephy-profile-migrator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/profile-migrator/ephy-profile-migrator.c b/src/profile-migrator/ephy-profile-migrator.c
index 368b1ed..a3a3242 100644
--- a/src/profile-migrator/ephy-profile-migrator.c
+++ b/src/profile-migrator/ephy-profile-migrator.c
@@ -576,7 +576,7 @@ parse_rdf_lang_tag (xmlNode  *child,
 
   locales = g_get_language_names ();
 
-  for (i = 0; locales[i] && i < *best_match; i++) {
+  for (i = 0; i < *best_match && locales[i]; i++) {
     if (!strcmp (locales[i], this_language)) {
       /* if we've already encountered a less accurate
        * translation, then free it */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]