diff options
author | Shixin Zeng <zeng.shixin@gmail.com> | 2009-05-28 12:52:23 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2009-05-28 12:52:23 +0300 |
commit | faeeebab030eee4610b41303754e44dc89239450 (patch) | |
tree | 72e30da3df98fd1257095f3bfd1ae95fa789c1ef | |
parent | 8607901a7406371d55874bb6c291351b4b0c4547 (diff) | |
download | glib-faeeebab030eee4610b41303754e44dc89239450.tar.gz |
Fix string length bugs in GWinHttpFile (#580347)
-rw-r--r-- | gio/win32/gwinhttpfile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gio/win32/gwinhttpfile.c b/gio/win32/gwinhttpfile.c index a4709ed4d..7e72b9f4e 100644 --- a/gio/win32/gwinhttpfile.c +++ b/gio/win32/gwinhttpfile.c @@ -387,12 +387,12 @@ g_winhttp_file_resolve_relative_path (GFile *file, child = g_object_new (G_TYPE_WINHTTP_FILE, NULL); child->vfs = winhttp_file->vfs; child->url = winhttp_file->url; - child->url.lpszScheme = g_memdup (winhttp_file->url.lpszScheme, winhttp_file->url.dwSchemeLength*2); - child->url.lpszHostName = g_memdup (winhttp_file->url.lpszHostName, winhttp_file->url.dwHostNameLength*2); - child->url.lpszUserName = g_memdup (winhttp_file->url.lpszUserName, winhttp_file->url.dwUserNameLength*2); - child->url.lpszPassword = g_memdup (winhttp_file->url.lpszPassword, winhttp_file->url.dwPasswordLength*2); + child->url.lpszScheme = g_memdup (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2); + child->url.lpszHostName = g_memdup (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2); + child->url.lpszUserName = g_memdup (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2); + child->url.lpszPassword = g_memdup (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2); child->url.lpszUrlPath = wnew_path; - child->url.dwUrlPathLength = 2*(wcslen (wnew_path)+1); + child->url.dwUrlPathLength = wcslen (wnew_path); child->url.lpszExtraInfo = NULL; child->url.dwExtraInfoLength = 0; |