Author: thebeing
Date: Fri Sep 16 09:56:48 2016
New Revision: 40085

URL: http://svn.gna.org/viewcvs/gnustep?rev=40085&view=rev
Log:
Fix a problem removing certificate data mapped to file names.

Modified:
    libs/base/trunk/ChangeLog
    libs/base/trunk/Source/GSTLS.m

Modified: libs/base/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=40085&r1=40084&r2=40085&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog   (original)
+++ libs/base/trunk/ChangeLog   Fri Sep 16 09:56:48 2016
@@ -1,3 +1,7 @@
+2016-09-16  Niels Grewe <niels.gr...@halbordnung.de>
+
+       * Source/GSTLS.m: Fix bug removing mapped certificates.
+
 2016-09-06  Richard Frith-Macdonald <r...@gnu.org>
 
        * Headers/Foundation/NSScanner.h:

Modified: libs/base/trunk/Source/GSTLS.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/GSTLS.m?rev=40085&r1=40084&r2=40085&view=diff
==============================================================================
--- libs/base/trunk/Source/GSTLS.m      (original)
+++ libs/base/trunk/Source/GSTLS.m      Fri Sep 16 09:56:48 2016
@@ -304,7 +304,16 @@
                   format: @"[GSTLS+dataForTLSFile:] called with bad file 
name"];
     }
   [fileLock lock];
-  result = [[fileMap objectForKey: fileName] retain];
+  NS_DURING
+    {
+      result = [[fileMap objectForKey: fileName] retain];
+    }
+  NS_HANDLER
+    {
+      [fileLock unlock];
+      [localException raise];
+    }
+  NS_ENDHANDLER
   [fileLock unlock];
   if (nil == result)
     {
@@ -369,7 +378,23 @@
                   format: @"[GSTLS+setData:forTLSFile:] called with bad file"];
     }
   [fileLock lock];
-  [fileMap setObject: data forKey: fileName];
+  NS_DURING
+    {
+      if (data == nil)
+        {
+          [fileMap removeObjectForKey: fileName];
+        }
+      else
+        {
+          [fileMap setObject: data forKey: fileName];
+        }
+    }
+  NS_HANDLER
+    {
+      [fileLock unlock];
+      [localException raise];
+    }
+  NS_ENDHANDLER
   [fileLock unlock];
 }
 


_______________________________________________
Gnustep-cvs mailing list
Gnustep-cvs@gna.org
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to