[svn] GnuPG - r5204 - branches/STABLE-BRANCH-2-0/agent

svn author wk cvs at cvs.gnupg.org
Wed Dec 2 20:02:33 CET 2009


Author: wk
Date: 2009-12-02 20:02:33 +0100 (Wed, 02 Dec 2009)
New Revision: 5204

Modified:
   branches/STABLE-BRANCH-2-0/agent/ChangeLog
   branches/STABLE-BRANCH-2-0/agent/trustlist.c
Log:
Fix realloc usage.  Fixes bug#1163.


Modified: branches/STABLE-BRANCH-2-0/agent/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-2-0/agent/ChangeLog	2009-12-02 19:00:10 UTC (rev 5203)
+++ branches/STABLE-BRANCH-2-0/agent/ChangeLog	2009-12-02 19:02:33 UTC (rev 5204)
@@ -1,3 +1,10 @@
+2009-12-02  Werner Koch  <wk at g10code.com>
+
+	* trustlist.c (read_trustfiles): Store the pointer returned from
+	shrinking the memory and not the orginal one.  Fixes bug#1163.
+	Reported by TAKAHASHI Tamotsu.  Also return correct error after
+	memory failure.
+
 2009-09-04  Marcus Brinkmann  <marcus at g10code.com>
 
 	* command.c (start_command_handler): Add comment about gap in

Modified: branches/STABLE-BRANCH-2-0/agent/trustlist.c
===================================================================
--- branches/STABLE-BRANCH-2-0/agent/trustlist.c	2009-12-02 19:00:10 UTC (rev 5203)
+++ branches/STABLE-BRANCH-2-0/agent/trustlist.c	2009-12-02 19:02:33 UTC (rev 5204)
@@ -361,13 +361,14 @@
   ti = xtryrealloc (table, (tableidx?tableidx:1) * sizeof *table);
   if (!ti)
     {
+      err = gpg_error_from_syserror ();
       xfree (table);
       return err;
     }
 
   lock_trusttable ();
   xfree (trusttable);
-  trusttable = table;
+  trusttable = ti;
   trusttablesize = tableidx;
   unlock_trusttable ();
   return 0;




More information about the Gnupg-commits mailing list