]> git.ipfire.org Git - thirdparty/git.git/commit
daemon: guard NULL REMOTE_PORT in execute() logging
authorSebastien Tardif <sebtardif@ncf.ca>
Thu, 28 May 2026 02:56:56 +0000 (02:56 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 May 2026 05:25:41 +0000 (14:25 +0900)
commit422a5bf57575a8c5d06faedfd77376501917e22c
tree95f4a35615ae8ad574018279acc119fa9be20dac
parent30c8fda1ab6d55d3b0129bb1686c23bf06cd5b0d
daemon: guard NULL REMOTE_PORT in execute() logging

REMOTE_ADDR and REMOTE_PORT are both set by the same code path in
handle(), so when the existing REMOTE_ADDR check passes, REMOTE_PORT
is guaranteed to be non-NULL.  Guard REMOTE_PORT as well so that a
future change that breaks this invariant does not pass NULL to
printf's %s, which is undefined behavior.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
daemon.c