aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-01-29 23:06:52 +0000
committerrowanbeentje <rowan@beent.je>2013-01-29 23:06:52 +0000
commit80fdadaa9375d443ec37982a438c4251912cda77 (patch)
tree67881fd277be58ae627e11b8d955412de064e613 /Source
parentce8f2ba8be4f20824f1db6bf3f45a890a92a108f (diff)
downloadsequelpro-80fdadaa9375d443ec37982a438c4251912cda77.tar.gz
sequelpro-80fdadaa9375d443ec37982a438c4251912cda77.tar.bz2
sequelpro-80fdadaa9375d443ec37982a438c4251912cda77.zip
- Fix a bounds check causing the preferences upgrade routine to fail in edge cases, addressing Issue #1547
- Bump the version number to 1.0.1
Diffstat (limited to 'Source')
-rw-r--r--Source/SPPreferencesUpgrade.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m
index fad33e7c..77af6b0a 100644
--- a/Source/SPPreferencesUpgrade.m
+++ b/Source/SPPreferencesUpgrade.m
@@ -375,11 +375,11 @@ void SPMigrateConnectionFavoritesData(void)
NSInteger lastFavoriteIndex = [prefs integerForKey:@"LastFavoriteIndex"];
NSInteger defaultFavoriteIndex = [prefs integerForKey:SPDefaultFavorite];
- if ((lastFavoriteIndex >= (NSInteger)0) && ((NSUInteger)lastFavoriteIndex <= [favorites count])) {
+ if ((lastFavoriteIndex >= (NSInteger)0) && ((NSUInteger)lastFavoriteIndex < [favorites count])) {
[prefs setInteger:[[[favorites objectAtIndex:lastFavoriteIndex] objectForKey:SPFavoriteIDKey] integerValue] forKey:SPLastFavoriteID];
}
- if ((defaultFavoriteIndex >= (NSInteger)0) && ((NSUInteger)defaultFavoriteIndex <= [favorites count])) {
+ if ((defaultFavoriteIndex >= (NSInteger)0) && ((NSUInteger)defaultFavoriteIndex < [favorites count])) {
[prefs setInteger:[[[favorites objectAtIndex:defaultFavoriteIndex] objectForKey:SPFavoriteIDKey] integerValue] forKey:SPDefaultFavorite];
}