[svn] gpgme - r1484 - trunk/src

svn author marcus cvs at cvs.gnupg.org
Tue Aug 3 11:16:02 CEST 2010


Author: marcus
Date: 2010-08-03 11:16:01 +0200 (Tue, 03 Aug 2010)
New Revision: 1484

Modified:
   trunk/src/ChangeLog
   trunk/src/gpgme-tool.c
Log:
2010-08-03  Marcus Brinkmann  <marcus at g10code.de>

        * gpgme-tool.c (result_encrypt_to_xml, result_sign_to_xml)
	(result_verify_to_xml, result_import_to_xml)
        (result_genkey_to_xml):	Check vigorously for null pointers.



Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2010-08-03 09:01:24 UTC (rev 1483)
+++ trunk/src/ChangeLog	2010-08-03 09:16:01 UTC (rev 1484)
@@ -1,5 +1,9 @@
 2010-08-03  Marcus Brinkmann  <marcus at g10code.de>
 
+	* gpgme-tool.c (result_encrypt_to_xml, result_sign_to_xml)
+	(result_verify_to_xml, result_import_to_xml)
+	(result_genkey_to_xml): Check vigorously for null pointers.
+
 	* w32-io.c (GPGCEDEV_IOCTL_ASSIGN_RVID): New macro.
 	(_gpgme_io_spawn): Use ASSIGN_RVID.
 

Modified: trunk/src/gpgme-tool.c
===================================================================
--- trunk/src/gpgme-tool.c	2010-08-03 09:01:24 UTC (rev 1483)
+++ trunk/src/gpgme-tool.c	2010-08-03 09:16:01 UTC (rev 1484)
@@ -742,8 +742,8 @@
 gpg_error_t
 result_add_timestamp (struct result_xml_state *state, char *name,
 		      unsigned int timestamp)
-{		  
-  char code[20];
+{
+  code[20];
 
   snprintf (code, sizeof (code) - 1, "%ui", timestamp);
   result_xml_tag_start (state, name, "unix", code, NULL);
@@ -828,7 +828,8 @@
       while (inv_recp)
 	{
 	  result_xml_tag_start (&state, "invalid-key", NULL);
-	  result_add_fpr (&state, "fpr", inv_recp->fpr);
+	  if (inv_recp->fpr)
+	    result_add_fpr (&state, "fpr", inv_recp->fpr);
 	  result_add_error (&state, "reason", inv_recp->reason);
 	  result_xml_tag_end (&state);
 	  inv_recp = inv_recp->next;
@@ -917,7 +918,8 @@
       while (inv_key)
 	{
 	  result_xml_tag_start (&state, "invalid-key", NULL);
-	  result_add_fpr (&state, "fpr", inv_key->fpr);
+	  if (inv_key->fpr)
+	    result_add_fpr (&state, "fpr", inv_key->fpr);
 	  result_add_error (&state, "reason", inv_key->reason);
 	  result_xml_tag_end (&state);
 	  inv_key = inv_key->next;
@@ -985,7 +987,8 @@
 	  
 	  /* FIXME: Could be done better. */
 	  result_add_value (&state, "summary", sig->summary);
-	  result_add_fpr (&state, "fpr", sig->fpr);
+	  if (sig->fpr)
+	    result_add_fpr (&state, "fpr", sig->fpr);
 	  result_add_error (&state, "status", sig->status);
 	  /* FIXME: notations */
 	  result_add_timestamp (&state, "timestamp", sig->timestamp);
@@ -1050,7 +1053,8 @@
 	{
 	  result_xml_tag_start (&state, "import-status", NULL);
 
-	  result_add_fpr (&state, "fpr", stat->fpr);
+	  if (stat->fpr)
+	    result_add_fpr (&state, "fpr", stat->fpr);
 	  result_add_error (&state, "result", stat->result);
 	  /* FIXME: Could be done better. */
 	  result_add_value (&state, "status", stat->status);
@@ -1082,7 +1086,8 @@
 
   result_add_value (&state, "primary", res->primary);
   result_add_value (&state, "sub", res->sub);
-  result_add_fpr (&state, "fpr", res->fpr);
+  if (res->fpr)
+    result_add_fpr (&state, "fpr", res->fpr);
 
   result_xml_tag_end (&state);
   





More information about the Gnupg-commits mailing list