path: root/extcap_spawn.c
diff options
authorRoland Knall <rknall@gmail.com>2017-12-27 19:19:49 +0100
committerRoland Knall <rknall@gmail.com>2017-12-27 19:52:45 +0000
commit3939ebe2738f85962d2a6152174d6e555aa82ff0 (patch)
treeb752d532c7b627b7a04dee715256590ca37dfead /extcap_spawn.c
parente65ce97f1ad432519a6dc2e6618683d9f7dbf27b (diff)
extcap: Increase spawn size
Increase the spawn size to prevent windows from stopping if the output of the extcap utility is too long Bug: 12845 Change-Id: I162b1322fd970777d2156d869e95b005b0f045ac Reviewed-on: https://code.wireshark.org/review/25014 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'extcap_spawn.c')
1 files changed, 5 insertions, 2 deletions
diff --git a/extcap_spawn.c b/extcap_spawn.c
index 42434df819..887694afca 100644
--- a/extcap_spawn.c
+++ b/extcap_spawn.c
@@ -37,8 +37,7 @@ gboolean extcap_spawn_sync(gchar *dirname, gchar *command, gint argc, gchar **ar
gchar *local_output = NULL;
#ifdef _WIN32
-#define BUFFER_SIZE 4096
- gchar buffer[BUFFER_SIZE];
+#define BUFFER_SIZE 16384
GString *winargs = g_string_sized_new(200);
gchar *quoted_arg;
@@ -119,9 +118,13 @@ gboolean extcap_spawn_sync(gchar *dirname, gchar *command, gint argc, gchar **ar
if (CreateProcess(NULL, wcommandline, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &info, &processInfo))
+ gchar* buffer;
WaitForSingleObject(processInfo.hProcess, INFINITE);
+ buffer = (gchar*)g_malloc(BUFFER_SIZE);
ws_read_string_from_pipe(child_stdout_rd, buffer, BUFFER_SIZE);
local_output = g_strdup_printf("%s", buffer);
+ g_free(buffer);