Revision: 4856 http://geany.svn.sourceforge.net/geany/?rev=4856&view=rev Author: eht16 Date: 2010-04-25 17:42:12 +0000 (Sun, 25 Apr 2010)
Log Message: ----------- Change the limit for the command line length when executing commands to a maximum of 32768 characters (closes #2979697).
Modified Paths: -------------- trunk/ChangeLog trunk/src/win32.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-04-25 17:42:01 UTC (rev 4855) +++ trunk/ChangeLog 2010-04-25 17:42:12 UTC (rev 4856) @@ -3,6 +3,9 @@ * src/build.c, src/dialogs.c, src/msgwindow.c, src/ui_utils.c: Replace g_vsnprintf() by g_strdup_vprintf() to avoid truncated strings in case of reaching the buffer size limit (part of #2979697). + * src/win32.c: + Change the limit for the command line length when executing commands + to a maximum of 32768 characters (closes #2979697).
2010-04-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/win32.c =================================================================== --- trunk/src/win32.c 2010-04-25 17:42:01 UTC (rev 4855) +++ trunk/src/win32.c 2010-04-25 17:42:12 UTC (rev 4856) @@ -57,6 +57,7 @@ #include "editor.h"
#define BUFSIZE 4096 +#define CMDSIZE 32768
struct _geany_win32_spawn { @@ -779,9 +780,9 @@ gboolean win32_spawn(const gchar *dir, gchar **argv, gchar **env, GSpawnFlags flags, gchar **std_out, gchar **std_err, gint *exit_status, GError **error) { - TCHAR buffer[MAX_PATH]=TEXT(""); - TCHAR cmdline[MAX_PATH] = TEXT(""); - TCHAR* lpPart[MAX_PATH]={NULL}; + TCHAR buffer[CMDSIZE]=TEXT(""); + TCHAR cmdline[CMDSIZE] = TEXT(""); + TCHAR* lpPart[CMDSIZE]={NULL}; DWORD retval = 0; gint argc = 0, i; gint cmdpos = 0; @@ -808,9 +809,9 @@
if (flags & G_SPAWN_SEARCH_PATH) { - retval = SearchPath(NULL, argv[0], ".exe", MAX_PATH, buffer, lpPart); + retval = SearchPath(NULL, argv[0], ".exe", sizeof(buffer), buffer, lpPart); if (retval > 0) - g_snprintf(cmdline, MAX_PATH, ""%s"", buffer); + g_snprintf(cmdline, sizeof(cmdline), ""%s"", buffer); else g_strlcpy(cmdline, argv[0], sizeof(cmdline)); cmdpos = 1; @@ -818,7 +819,7 @@
for (i = cmdpos; i < argc; i++) { - g_snprintf(cmdline, MAX_PATH, "%s %s", cmdline, argv[i]); + g_snprintf(cmdline, sizeof(cmdline), "%s %s", cmdline, argv[i]); /*MessageBox(NULL, cmdline, cmdline, MB_OK);*/ }
@@ -1010,7 +1011,7 @@ STARTUPINFOW siStartInfo; BOOL bFuncRetn = FALSE; gchar *expandedCmdline; - wchar_t w_commandline[MAX_PATH]; + wchar_t w_commandline[CMDSIZE]; wchar_t w_dir[MAX_PATH];
/* Set up members of the PROCESS_INFORMATION structure. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.