iOS: Fixed possible crash on disconnect
authorMartin Fleisz <mfleisz@thinstuff.at>
Wed, 17 Apr 2013 11:09:53 +0000 (13:09 +0200)
committerMartin Fleisz <mfleisz@thinstuff.at>
Wed, 17 Apr 2013 11:09:53 +0000 (13:09 +0200)
client/iOS/Models/RDPSession.m
libfreerdp/crypto/der.c

index af400bb..87a1aaf 100644 (file)
@@ -190,7 +190,9 @@ NSString* TSXSessionDidFailToConnectNotification = @"TSXSessionDidFailToConnect"
 
 - (CGContextRef)bitmapContext
 {
-       return [self mfi]->bitmap_context;
+    if ([self mfi]->connection_state == TSXConnectionConnected)
+        return [self mfi]->bitmap_context;
+    return NULL;
 }
 
 #pragma mark -
index 7c4694f..1cc5eb7 100644 (file)
@@ -27,9 +27,9 @@
 
 int _der_skip_length(int length)
 {
-       if (length > 0x81 && length <= 0x102)
+       if (length > 0x7F && length <= 0xFF)
                return 2;
-       else if (length > 0x102)
+       else if (length > 0xFF)
                return 3;
        else
                return 1;