diff options
author | Xan Lopez <xan@gnome.org> | 2009-09-10 17:54:27 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2009-09-10 17:56:37 +0800 |
commit | f433ee264428a8289aa6f6ea45e1efd317a39e87 (patch) | |
tree | 4db0db07d8f1d166fed2e4c3a464a8bc079daa63 /src | |
parent | 11f91ceca1f1185fbf523c24e7b5f8d63e041da4 (diff) | |
download | gsoc2013-epiphany-f433ee264428a8289aa6f6ea45e1efd317a39e87.tar gsoc2013-epiphany-f433ee264428a8289aa6f6ea45e1efd317a39e87.tar.gz gsoc2013-epiphany-f433ee264428a8289aa6f6ea45e1efd317a39e87.tar.bz2 gsoc2013-epiphany-f433ee264428a8289aa6f6ea45e1efd317a39e87.tar.lz gsoc2013-epiphany-f433ee264428a8289aa6f6ea45e1efd317a39e87.tar.xz gsoc2013-epiphany-f433ee264428a8289aa6f6ea45e1efd317a39e87.tar.zst gsoc2013-epiphany-f433ee264428a8289aa6f6ea45e1efd317a39e87.zip |
ephy-profile-migration.c: fix crash when importing some profiles
Be more careful about not going over the end of the lines array.
Bug #594717
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-profile-migration.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ephy-profile-migration.c b/src/ephy-profile-migration.c index 3acf60627..83089158f 100644 --- a/src/ephy-profile-migration.c +++ b/src/ephy-profile-migration.c @@ -152,6 +152,7 @@ parse_and_decrypt_signons (const char *signons) int version; gchar **lines; int i; + guint length; lines = g_strsplit (signons, "\r\n", -1); if (!g_ascii_strncasecmp (lines[0], "#2c", 3)) @@ -175,7 +176,9 @@ parse_and_decrypt_signons (const char *signons) * separated by lines that only contain a dot. We find a block by * the separator and parse them one by one. */ - while (lines[i]) { + length = g_strv_length (lines); + + while (i < length) { size_t begin = i; size_t end = i + 1; const char *realmBracketBegin = " ("; @@ -268,7 +271,7 @@ parse_and_decrypt_signons (const char *signons) if (version >= 2) { if (begin < end) /* Skip it */ ; - begin ++; + begin++; /* Version 3 has an extra line for further use */ if (version == 3) |