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

gEDA-cvs: pcb.git: branch: master updated (f290499bd7d5570727721326de1b7f59b6af2d07)



The branch, master has been updated
       via  f290499bd7d5570727721326de1b7f59b6af2d07 (commit)
      from  e8c5111b4abc2b3d03d4574c0583aad6ecc708dd (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
=========

 src/hid/gtk/gui-library-window.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)


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

commit f290499bd7d5570727721326de1b7f59b6af2d07
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    gtk: library window: ignore element if LoadElementToBuffer fails
    
    In gtk/gui-library-window.c, the library window's selection-change
    callback calls LoadElementToBuffer() to read the selected element,
    so it can show a preview and select the element if necessary.
    
    The return value of this determines whether to set pcb's mode to
    PASTEBUFFER_MODE. However, the library window preview is attempted
    regardless. If LoadElementToBuffer failed, this causes a NULL
    reference and segfault.
    
    This patch skips the preview in the case that LoadElementToBuffer.
    
    Closes-bug: lp-853628
    Closes-bug: lp-852600

:100644 100644 74b55e9... 96b5f1f... M	src/hid/gtk/gui-library-window.c

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

commit f290499bd7d5570727721326de1b7f59b6af2d07
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    gtk: library window: ignore element if LoadElementToBuffer fails
    
    In gtk/gui-library-window.c, the library window's selection-change
    callback calls LoadElementToBuffer() to read the selected element,
    so it can show a preview and select the element if necessary.
    
    The return value of this determines whether to set pcb's mode to
    PASTEBUFFER_MODE. However, the library window preview is attempted
    regardless. If LoadElementToBuffer failed, this causes a NULL
    reference and segfault.
    
    This patch skips the preview in the case that LoadElementToBuffer.
    
    Closes-bug: lp-853628
    Closes-bug: lp-852600

diff --git a/src/hid/gtk/gui-library-window.c b/src/hid/gtk/gui-library-window.c
index 74b55e9..96b5f1f 100644
--- a/src/hid/gtk/gui-library-window.c
+++ b/src/hid/gtk/gui-library-window.c
@@ -387,8 +387,11 @@ library_window_callback_tree_selection_changed (GtkTreeSelection * selection,
   if (entry->Template == (char *) -1)
     {
       if (LoadElementToBuffer (PASTEBUFFER, entry->AllocatedMemory, true))
-	SetMode (PASTEBUFFER_MODE);
-      goto out;
+        {
+          SetMode (PASTEBUFFER_MODE);
+          goto out;
+        }
+      return;
     }
 
   /* Otherwise, it's a m4 element and we need to create a string of
@@ -399,8 +402,14 @@ library_window_callback_tree_selection_changed (GtkTreeSelection * selection,
 			     EMPTY (entry->Value), EMPTY (entry->Package));
 
   if (LoadElementToBuffer (PASTEBUFFER, m4_args, false))
-    SetMode (PASTEBUFFER_MODE);
+    {
+      SetMode (PASTEBUFFER_MODE);
+      g_free (m4_args);
+      goto out;
+    }
+
   g_free (m4_args);
+  return;
 
 out:
 




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