[Winpt-commits] r210 - trunk/Src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu May 4 10:44:12 CEST 2006


Author: twoaday
Date: 2006-05-04 10:44:11 +0200 (Thu, 04 May 2006)
New Revision: 210

Modified:
   trunk/Src/ChangeLog
   trunk/Src/wptKeyCache.cpp
Log:
2006-05-03  Timo Schulz  <ts at g10code.de>
                                                                                
        * wptKeyCache.cpp (keycache_prepare2): Fix possible segv.
        Thanks to Mathias.



Modified: trunk/Src/ChangeLog
===================================================================
--- trunk/Src/ChangeLog	2006-05-03 14:34:08 UTC (rev 209)
+++ trunk/Src/ChangeLog	2006-05-04 08:44:11 UTC (rev 210)
@@ -1,3 +1,8 @@
+2006-05-03  Timo Schulz  <ts at g10code.de>
+
+	* wptKeyCache.cpp (keycache_prepare2): Fix possible segv.
+	Thanks to Mathias.
+	
 2006-05-02  Timo Schulz  <ts at g10code.de>
 
 	* wptFileManagerDlg.cpp (file_encrypt_dlg_proc): Use a

Modified: trunk/Src/wptKeyCache.cpp
===================================================================
--- trunk/Src/wptKeyCache.cpp	2006-05-03 14:34:08 UTC (rev 209)
+++ trunk/Src/wptKeyCache.cpp	2006-05-04 08:44:11 UTC (rev 210)
@@ -376,9 +376,7 @@
 		goto next;
 	    c->gloflags.has_desig_rev = 1;
 	}
-	if (pkt->pkttype == PKT_SIGNATURE && key_seen == 1 && c != NULL) {
-	    if (c->sym_prefs) /* only use the prefs from the primary uid. */
-		goto next;
+	if (pkt->pkttype == PKT_SIGNATURE && key_seen == 1) {
 	    sym_prefs = gpg_parse_sig_subpkt (pkt->pkt.signature->hashed,
 				              SIGSUBPKT_PREF_SYM, &nsym);
 	    if (!sym_prefs)
@@ -388,8 +386,10 @@
 	    if (kid && strcmp (kid, keyid) != 0)
 		goto next;
 	    err = gpg_keycache_find_key2 (ctx, keyid, 0, &key, &c);
-	    if (err)
+	    if (err || !c)
 		goto next;
+	    if (c->sym_prefs) /* only use the prefs from the primary uid. */
+		goto next;
 	    else if (nsym > 0) {
 		c->sym_prefs = (unsigned char*)calloc (1, nsym+1);
 		if (!c->sym_prefs)



More information about the Winpt-commits mailing list