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

gEDA-cvs: gaf.git: branch: stable-1.4 updated (1.4.2-20081220-10-g22d9457)



The branch, stable-1.4 has been updated
       via  22d9457c68d756675facc5acfebebca96299a766 (commit)
      from  6f001abc5c1fc69bb5bfbece189efbd231a8ed4c (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/g_keys.c   |    2 +-
 gschem/src/x_menus.c  |    2 +-
 gschem/src/x_stroke.c |    2 +-
 libgeda/src/g_basic.c |    4 +++-
 4 files changed, 6 insertions(+), 4 deletions(-)


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

commit 22d9457c68d756675facc5acfebebca96299a766
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date:   Tue Dec 30 23:49:17 2008 +0000

    Validate calls to scm_c_eval_string(). [2105219]
    
    Because the reporter's version of Guile is broken, a lovely garbage
    collector segfault occurs if a null string is passed to
    scm_c_eval_string().
    
    For now, replace most calls to scm_c_eval_string() with user-provided
    arguments by g_scm_c_eval_string_protected(), and modify the latter to
    behave well with a NULL argument. This has the added advantage of
    providing backtraces in more places.
    
    Cherry-picked from: 2a4fdb13021d0153e788fe3b2fc005f273dcdf4b
                        16102ef095c959b5c1febb9b9259dda23c739258

:100644 100644 b01db41... 89f6684... M	gschem/src/g_keys.c
:100644 100644 167df2c... 056ac00... M	gschem/src/x_menus.c
:100644 100644 a557761... 1acb618... M	gschem/src/x_stroke.c
:100644 100644 1cfd062... 13017b8... M	libgeda/src/g_basic.c

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

commit 22d9457c68d756675facc5acfebebca96299a766
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date:   Tue Dec 30 23:49:17 2008 +0000

    Validate calls to scm_c_eval_string(). [2105219]
    
    Because the reporter's version of Guile is broken, a lovely garbage
    collector segfault occurs if a null string is passed to
    scm_c_eval_string().
    
    For now, replace most calls to scm_c_eval_string() with user-provided
    arguments by g_scm_c_eval_string_protected(), and modify the latter to
    behave well with a NULL argument. This has the added advantage of
    providing backtraces in more places.
    
    Cherry-picked from: 2a4fdb13021d0153e788fe3b2fc005f273dcdf4b
                        16102ef095c959b5c1febb9b9259dda23c739258

diff --git a/gschem/src/g_keys.c b/gschem/src/g_keys.c
index b01db41..89f6684 100644
--- a/gschem/src/g_keys.c
+++ b/gschem/src/g_keys.c
@@ -108,7 +108,7 @@ int g_keys_execute(GSCHEM_TOPLEVEL *w_current, int state, int keyval)
 #if DEBUG 
   printf("_%s_\n", guile_string);
 #endif
-  scm_retval = scm_c_eval_string (guile_string);
+  scm_retval = g_scm_c_eval_string_protected (guile_string);
   g_free(guile_string);
   g_free(modifier);
 
diff --git a/gschem/src/x_menus.c b/gschem/src/x_menus.c
index 167df2c..056ac00 100644
--- a/gschem/src/x_menus.c
+++ b/gschem/src/x_menus.c
@@ -162,7 +162,7 @@ void get_main_menu(GtkWidget ** menubar)
         gtk_menu_append(GTK_MENU(menu), menu_item);
       } else { 
         buf = g_strdup_printf("(find-key '%s)", menu_item_hotkey_func);
-        scm_keys = scm_c_eval_string (buf);
+        scm_keys = g_scm_c_eval_string_protected (buf);
 	g_free(buf);
         if (scm_keys == SCM_BOOL_F) {
           menu_item_keys = g_malloc(sizeof(char)*2);
diff --git a/gschem/src/x_stroke.c b/gschem/src/x_stroke.c
index a557761..1acb618 100644
--- a/gschem/src/x_stroke.c
+++ b/gschem/src/x_stroke.c
@@ -141,7 +141,7 @@ int x_stroke_search_execute(char *sequence)
 
   guile_string = g_strdup_printf("(eval-stroke \"%s\")", sequence);
 
-  eval = scm_c_eval_string (guile_string);
+  eval = g_scm_c_eval_string_protected (guile_string);
   g_free(guile_string);
 
   return (SCM_FALSEP (eval)) ? 0 : 1;
diff --git a/libgeda/src/g_basic.c b/libgeda/src/g_basic.c
index 1cfd062..13017b8 100644
--- a/libgeda/src/g_basic.c
+++ b/libgeda/src/g_basic.c
@@ -209,7 +209,9 @@ static SCM protected_body_eval_string (void *data)
  *  \returns Evaluation results or SCM_BOOL_F if exception caught.
  */
 SCM g_scm_c_eval_string_protected (const gchar *str) {
-  SCM s_str = scm_from_locale_string (str);
+  SCM s_str;
+  g_return_val_if_fail ((str != NULL), SCM_BOOL_F);
+  s_str = scm_from_locale_string (str);
   return g_scm_eval_string_protected (s_str);
 }
 




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