path: root/compat/win32/syslog.c
AgeCommit message (Collapse)Author
2017-08-10win32: plug memory leak on realloc() failure in syslog()René Scharfe
If realloc() fails then the original buffer is still valid. Free it before exiting the function. Signed-off-by: Rene Scharfe <> Signed-off-by: Junio C Hamano <>
2016-05-09compat/win32/syslog.c: use warning_errno()Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <> Signed-off-by: Junio C Hamano <>
2016-02-22use st_add and st_mult for allocation size computationJeff King
If our size computation overflows size_t, we may allocate a much smaller buffer than we expected and overflow it. It's probably impossible to trigger an overflow in most of these sites in practice, but it is easy enough convert their additions and multiplications into overflow-checking variants. This may be fixing real bugs, and it makes auditing the code easier. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2011-10-07mingw: avoid using strbuf in syslogErik Faye-Lund
strbuf can call die, which again can call syslog from git-daemon. Endless recursion is no fun; fix it by hand-rolling the logic. As a side-effect malloc/realloc errors are changed into non-fatal warnings; this is probably an improvement anyway. Signed-off-by: Erik Faye-Lund <> Noticed-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
2010-11-04mingw: implement syslogMike Pape
Syslog does not usually exist on Windows, so implement our own using Window's ReportEvent mechanism. Strings containing "%1" gets expanded into them selves by ReportEvent, resulting in an unreadable string. "%2" and above is not a problem. Unfortunately, on Windows an IPv6 address can contain "%1", so expand "%1" to "% 1" before reporting. "%%1" is also a problem for ReportEvent, but that string cannot occur in an IPv6 address. Signed-off-by: Mike Pape <> Signed-off-by: Erik Faye-Lund <> Signed-off-by: Junio C Hamano <>