[geany/geany] 8dd775: spawn: Don't truncate a NULL GString

Colomban Wendling git-noreply at xxxxx
Sat Feb 13 17:23:10 UTC 2016


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 13 Feb 2016 17:23:10 UTC
Commit:      8dd77590480852b9f112dce906d2c981cc664ce9
             https://github.com/geany/geany/commit/8dd77590480852b9f112dce906d2c981cc664ce9

Log Message:
-----------
spawn: Don't truncate a NULL GString


Modified Paths:
--------------
    src/spawn.c

Modified: src/spawn.c
6 lines changed, 4 insertions(+), 2 deletions(-)
===================================================================
@@ -1202,8 +1202,10 @@ gboolean spawn_sync(const gchar *working_directory, const gchar *command_line, g
 	gchar **envp, SpawnWriteData *stdin_data, GString *stdout_data, GString *stderr_data,
 	gint *exit_status, GError **error)
 {
-	g_string_truncate(stdout_data, 0);
-	g_string_truncate(stderr_data, 0);
+	if (stdout_data)
+		g_string_truncate(stdout_data, 0);
+	if (stderr_data)
+		g_string_truncate(stderr_data, 0);
 
 	return spawn_with_callbacks(working_directory, command_line, argv, envp, SPAWN_SYNC |
 		SPAWN_UNBUFFERED, stdin_data ? (GIOFunc) spawn_write_data : NULL, stdin_data,



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list