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

gEDA-cvs: gaf.git: branch: master updated (1.7.0-20110116-66-gfdd787a)



The branch, master has been updated
       via  fdd787ab8698585d5d10ba2cf2e5dd716388460a (commit)
       via  3a5644f8804fe73e15d79db1dd2959a66aef7fe7 (commit)
      from  4711b134809efe2f7f673c8bf26eae295a54bbad (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
=========

 utils/src/gsch2pcb.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)


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

commit fdd787ab8698585d5d10ba2cf2e5dd716388460a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gsch2pcb: Follow g_spawn_sync() documentation and pass required flags
    
    The documentation for g_spawn_sync() tells us that we must pass the
    flags G_SPAWN_STDOUT_TO_DEV_NULL and G_SPAWN_STDERR_TO_DEV_NULL if we
    pass NULL for the stdout and stderr returns from the command.
    
    These flags cause g_spawn_sync() to redirect stdout and stderr to
    /dev/null rather than assigning pipes to them.
    
    No known bug is fixed by this, but it is possible that without these
    flags, either the stdout or stderr pipes' buffer could become full if
    the command executing emits enough data. This might lead to both
    processes stalling.
    
    Whilst I was touching this code, I added some comments as to the
    meaning of the various NULL arguments we pass to g_spawn_sync().

:100644 100644 8b667f0... 4bc7e61... M	utils/src/gsch2pcb.c

commit 3a5644f8804fe73e15d79db1dd2959a66aef7fe7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gsch2pcb: NULL termiate the argument list to g_spawn_sync()
    
    Fixes mysterious failures which leave a message on the console:
    
      gsch2pcb: gnetlist command failed, `<FILENAME>' not updated
         at least gnetlist 20030901 is required for m4-xxx options.
    
    Could potentially be a security flaw, as the argument list to execute
    would be parsed off the end of unallocated memory until a NULL pointer
    happened to be found.
    
    Might fix crashes, but couldn't find any relevant bug reports.

:100644 100644 85b7cb3... 8b667f0... M	utils/src/gsch2pcb.c

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

commit fdd787ab8698585d5d10ba2cf2e5dd716388460a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gsch2pcb: Follow g_spawn_sync() documentation and pass required flags
    
    The documentation for g_spawn_sync() tells us that we must pass the
    flags G_SPAWN_STDOUT_TO_DEV_NULL and G_SPAWN_STDERR_TO_DEV_NULL if we
    pass NULL for the stdout and stderr returns from the command.
    
    These flags cause g_spawn_sync() to redirect stdout and stderr to
    /dev/null rather than assigning pipes to them.
    
    No known bug is fixed by this, but it is possible that without these
    flags, either the stdout or stderr pipes' buffer could become full if
    the command executing emits enough data. This might lead to both
    processes stalling.
    
    Whilst I was touching this code, I added some comments as to the
    meaning of the various NULL arguments we pass to g_spawn_sync().

diff --git a/utils/src/gsch2pcb.c b/utils/src/gsch2pcb.c
index 8b667f0..4bc7e61 100644
--- a/utils/src/gsch2pcb.c
+++ b/utils/src/gsch2pcb.c
@@ -177,8 +177,18 @@ build_and_run_command (const gchar *format, ...)
     if (verbose)
       printf ("\n%s", SEP_STRING);
 
-    g_spawn_sync (".", args, NULL, G_SPAWN_SEARCH_PATH,
-                  NULL, NULL, NULL, NULL, NULL, NULL);
+    g_spawn_sync (".",                  /* Working directory */
+                  args,                 /* argv */
+                  NULL,                 /* envp */
+                  G_SPAWN_SEARCH_PATH | /* flags */
+                  G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
+                  NULL,                 /* child_setup */
+                  NULL,                 /* user data */
+                  NULL,                 /* standard output */
+                  NULL,                 /* standard error */
+                  NULL,                 /* exit status return */
+                  NULL                  /* GError return */
+                 );
 
     if (verbose)
       printf ("\n%s", SEP_STRING);

commit 3a5644f8804fe73e15d79db1dd2959a66aef7fe7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gsch2pcb: NULL termiate the argument list to g_spawn_sync()
    
    Fixes mysterious failures which leave a message on the console:
    
      gsch2pcb: gnetlist command failed, `<FILENAME>' not updated
         at least gnetlist 20030901 is required for m4-xxx options.
    
    Could potentially be a security flaw, as the argument list to execute
    would be parsed off the end of unallocated memory until a NULL pointer
    happened to be found.
    
    Might fix crashes, but couldn't find any relevant bug reports.

diff --git a/utils/src/gsch2pcb.c b/utils/src/gsch2pcb.c
index 85b7cb3..8b667f0 100644
--- a/utils/src/gsch2pcb.c
+++ b/utils/src/gsch2pcb.c
@@ -163,7 +163,7 @@ build_and_run_command (const gchar *format, ...)
     /* we have something in the list, build & call command */
     GList *p;
     gint i = 0;
-    gchar ** args = g_new0 (gchar*, g_list_length (tmp));
+    gchar ** args = g_new0 (gchar*, g_list_length (tmp) + 1/* NULL terminate the list */);
 
     if (verbose)
       printf ("Running command:\n\t");




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