1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-19 07:06:09 +02:00
git/compat/win32
Johannes Schindelin 417fb91b5d compat/win32/syslog: fix use-after-realloc
Git for Windows' SDK recently upgraded to GCC v12.x which points out
that the `pos` variable might be used even after the corresponding
memory was `realloc()`ed and therefore potentially no longer valid.

Since a subset of this SDK is used in Git's CI/PR builds, we need to fix
this to continue to be able to benefit from the CI/PR runs.

Note: This bug has been with us since 2a6b149c64 (mingw: avoid using
strbuf in syslog, 2011-10-06), and while it looks tempting to replace
the hand-rolled string manipulation with a `strbuf`-based one, that
commit's message explains why we cannot do that: The `syslog()` function
is called as part of the function in `daemon.c` which is set as the
`die()` routine, and since `strbuf_grow()` can call that function if it
runs out of memory, this would cause a nasty infinite loop that we do
not want to re-introduce.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-12 20:31:52 +01:00
..
alloca.h mingw: activate alloca 2014-04-09 10:08:35 -07:00
dirent.c Win32: Unicode file name support (dirent) 2014-07-15 11:19:09 -07:00
dirent.h Win32: Unicode file name support (dirent) 2014-07-15 11:19:09 -07:00
git.manifest mingw: embed a manifest to trick UAC into Doing The Right Thing 2019-06-27 12:55:45 -07:00
lazyload.h Win32: simplify loading of DLL functions 2017-09-26 11:02:49 +09:00
path-utils.c Sync with 2.20.2 2019-12-06 16:31:12 +01:00
path-utils.h run-command: trigger PATH lookup properly on Cygwin 2020-03-27 11:06:17 -07:00
pthread.c win32: replace pthread_cond_*() with much simpler code 2018-11-14 15:14:22 +09:00
pthread.h pthread.h: manually align parameter lists 2019-10-11 14:59:35 +09:00
syslog.c compat/win32/syslog: fix use-after-realloc 2023-03-12 20:31:52 +01:00
syslog.h mingw: implement syslog 2010-11-04 16:53:49 -07:00
trace2_win32_process_info.c trace2: report peak memory usage of the process 2019-04-16 13:37:07 +09:00