mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-18 13:28:47 +02:00
gspawn-win32: Fix potential integer overflows in argv handling
This can happen if a user passes a ludicrously long string to argv. Spotted by chamalsl as #YWH-PGM9867-48. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
913a1bfd85
commit
3d9cc10330
@ -80,8 +80,8 @@ protect_wargv (gint argc,
|
||||
{
|
||||
wchar_t *p = wargv[i];
|
||||
wchar_t *q;
|
||||
gint len = 0;
|
||||
gint pre_bslash = 0;
|
||||
size_t len = 0;
|
||||
size_t pre_bslash = 0;
|
||||
gboolean need_dblquotes = FALSE;
|
||||
while (*p)
|
||||
{
|
||||
|
@ -253,8 +253,8 @@ protect_argv_string (const gchar *string)
|
||||
{
|
||||
const gchar *p = string;
|
||||
gchar *retval, *q;
|
||||
gint len = 0;
|
||||
gint pre_bslash = 0;
|
||||
size_t len = 0;
|
||||
size_t pre_bslash = 0;
|
||||
gboolean need_dblquotes = FALSE;
|
||||
while (*p)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user