mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-21 10:38:12 +00:00
fix(user): check session key value before using it
This commit is contained in:
1 parent
4dcda8f72d
commit
868ecbea55
2 files changed
+7
-1
No files matched your search
@@ -204,7 +204,7 @@ static NSString *sessionsFolderURLString = nil;
|
||||
NSArray *attrs;
|
||||
NSDictionary *record;
|
||||
EOEntity *entity;
|
||||
EOSQLQualifier *qualifier;
|
||||
EOQualifier *qualifier;
|
||||
|
||||
record = nil;
|
||||
|
||||
@@ -217,6 +217,7 @@ static NSString *sessionsFolderURLString = nil;
|
||||
qualifierFormat:
|
||||
@"c_id='%@'",
|
||||
theID];
|
||||
|
||||
[qualifier autorelease];
|
||||
|
||||
[context beginTransaction];
|
||||
|
||||
@@ -45,6 +45,11 @@
|
||||
|
||||
cache = [SOGoCache sharedCache];
|
||||
|
||||
//We check that the session is base64
|
||||
NSData *decodedData = [[NSData alloc] initWithBase64EncodedString:theSessionKey options:0];
|
||||
if(!decodedData)
|
||||
return value;
|
||||
|
||||
key = [NSString stringWithFormat: @"session:%@", theSessionKey];
|
||||
value = [cache valueForKey: key];
|
||||
|
||||
|
||||
Reference in new issue
Block a user