[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: branch: master updated (1.3.1-20080110-12-gfccaae6)



The branch, master has been updated
       via  fccaae6b363d7f81ab94725751314813c42b718d (commit)
      from  f9790765a7961ebb154d1c038938aded012c5c90 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/src/o_net.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)


=================
 Commit Messages
=================

commit fccaae6b363d7f81ab94725751314813c42b718d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Jan 16 20:08:27 2008 +0000

    Fix use after free corruption when consolidating nets

:100644 100644 7adca6b... 20154fc... M	gschem/src/o_net.c

=========
 Changes
=========

commit fccaae6b363d7f81ab94725751314813c42b718d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Jan 16 20:08:27 2008 +0000

    Fix use after free corruption when consolidating nets

diff --git a/gschem/src/o_net.c b/gschem/src/o_net.c
index 7adca6b..20154fc 100644
--- a/gschem/src/o_net.c
+++ b/gschem/src/o_net.c
@@ -433,6 +433,9 @@ int o_net_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
       o_cue_draw_list(w_current, other_objects);
       o_cue_draw_single(w_current, new_net);
 
+      g_list_free(other_objects);
+      other_objects = NULL;
+
       /* Go off and search for valid connection on this newly created net */
       found_primary_connection = s_conn_net_search(new_net, 1, 
                                                    new_net->conn_list);
@@ -445,7 +448,9 @@ int o_net_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
 
       /* you don't want to consolidate nets which are drawn non-ortho */
       if (toplevel->net_consolidate == TRUE && !w_current->CONTROLKEY) {
-	  o_net_consolidate_segments(toplevel, new_net);
+        /* CAUTION: Object list will change when nets are consolidated, don't
+         *          keep pointers to other objects than new_net after this. */
+        o_net_consolidate_segments(toplevel, new_net);
       }
   }
 
@@ -493,14 +498,16 @@ int o_net_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
       o_cue_draw_list(w_current, other_objects);
       o_cue_draw_single(w_current, new_net);
 
+      g_list_free(other_objects);
+      other_objects = NULL;
+
       /* you don't want to consolidate nets which are drawn non-ortho */
       if (toplevel->net_consolidate == TRUE && !w_current->CONTROLKEY) {
-	  o_net_consolidate_segments(toplevel, new_net);
+        /* CAUTION: Object list will change when nets are consolidated, don't
+         *          keep pointers to other objects than new_net after this. */
+        o_net_consolidate_segments(toplevel, new_net);
       }
   }
-  
-  /* LEAK CHECK 3 */
-  g_list_free(other_objects);
 
   toplevel->page_current->CHANGED = 1;
   w_current->start_x = w_current->save_x;




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs