aboutsummaryrefslogtreecommitdiff
path: root/git-gui/lib/win32.tcl
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-06-12 17:28:08 -0400
committerJunio C Hamano <gitster@pobox.com>2015-06-15 13:25:50 -0700
commitf3612acb9302fc9332958b77c5ca5fc05cacb029 (patch)
treedfd082d1ac1b51b36480be866f30f805396debfc /git-gui/lib/win32.tcl
parenta5fe66802f8c4036badd54ff36ff327d43236e7e (diff)
downloadgit-f3612acb9302fc9332958b77c5ca5fc05cacb029.tar.gz
git-f3612acb9302fc9332958b77c5ca5fc05cacb029.tar.xz
pkt-line: simplify starts_with checks in packet tracing
We carefully check that our pkt buffer has enough characters before seeing if it starts with "PACK". The intent is to avoid reading random memory if we get a short buffer like "PAC". However, we know that the traced packets are always NUL-terminated. They come from one of these sources: 1. A string literal. 2. `format_packet`, which uses a strbuf. 3. `packet_read`, which defensively NUL-terminates what we read. We can therefore drop the length checks, as we know we will hit the trailing NUL if we have a short input. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-gui/lib/win32.tcl')
0 files changed, 0 insertions, 0 deletions