glib/gio/win32
Philip Withnall 0cbad67321 gwinhttpfile: Avoid arithmetic overflow when calculating a size
The members of `URL_COMPONENTS` (`winhttp_file->url`) are `DWORD`s, i.e.
32-bit unsigned integers. Adding to and multiplying them may cause them
to overflow the unsigned integer bounds, even if the result is passed to
`g_memdup2()` which accepts a `gsize`.

Cast the `URL_COMPONENTS` members to `gsize` first to ensure that the
arithmetic is done in terms of `gsize`s rather than unsigned integers.

Spotted by Sebastian Dröge.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #2319
2021-02-04 17:51:01 +00:00
..
gwin32filemonitor.c gio/win32/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gwin32filemonitor.h gio/win32/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gwin32fsmonitorutils.c tree: Fix various typos and outdated terminology 2020-06-12 15:01:08 +01:00
gwin32fsmonitorutils.h gio/win32/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gwinhttpfile.c gwinhttpfile: Avoid arithmetic overflow when calculating a size 2021-02-04 17:51:01 +00:00
gwinhttpfile.h gio/win32/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gwinhttpfileinputstream.c gio/win32/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gwinhttpfileinputstream.h gio/win32/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gwinhttpfileoutputstream.c gio/win32/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gwinhttpfileoutputstream.h gio/win32/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gwinhttpvfs.c gwinhttpvfs: Handle g_get_prgname() returning NULL 2019-10-06 20:05:44 +02:00
gwinhttpvfs.h gio/win32/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
meson.build build: Drop use of G_DISABLE_DEPRECATED from the build system 2019-05-30 10:38:45 +01:00
winhttp.h License headers: replace current FSF address by a link to gnu.org 2017-01-04 19:12:57 +01:00