]> git.ipfire.org Git - thirdparty/git.git/commit - color.c
color: add overflow checks for parsing colors
authorJeff King <peff@peff.net>
Thu, 24 Sep 2015 21:08:07 +0000 (17:08 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Oct 2015 18:08:05 +0000 (11:08 -0700)
commitcbc8feeaf97db39ff7220c4d1b03e0c3fdd2401c
tree25da120e88159ab40aec7646ecc7f1abbd6b091e
parent2b87d3a89633fb6078203a77d2610175f94cef95
color: add overflow checks for parsing colors

Our color parsing is designed to never exceed COLOR_MAXLEN
bytes. But the relationship between that hand-computed
number and the parsing code is not at all obvious, and we
merely hope that it has been computed correctly for all
cases.

Let's mark the expected "end" pointer for the destination
buffer and make sure that we do not exceed it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
color.c