winansi: avoid buffer overrun
commitb6b066adf9e1e970a6d8295db630ab1e1f3bc71c
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 4 May 2017 13:55:34 +0000 (4 15:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 May 2017 03:18:19 +0000 (8 12:18 +0900)
treecb406803715e04953a1745fbb26f8c1f85d672ff
parent3057da5ad51b3256a6f6b94d034e6a5571ce5ece
winansi: avoid buffer overrun

When we could not convert the UTF-8 sequence into Unicode for writing to
the Console, we should not try to write an insanely-long sequence of
invalid wide characters (mistaking the negative return value for an
unsigned length).

Reported by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/winansi.c