xdiff: cast arguments for ctype functions to unsigned char
authorJonathan Nieder <redacted>
Mon, 4 Oct 2010 09:09:17 +0000 (04:09 -0500)
committerJunio C Hamano <redacted>
Wed, 6 Oct 2010 17:46:45 +0000 (10:46 -0700)
commit349362cc207c96bbf31f503db989f0289c13c05d
tree507437c460f5a35b8377b6f821ab448ea1027610
parent9173912be36c4f967f42f176be767fc5ba3c4077
xdiff: cast arguments for ctype functions to unsigned char

The ctype functions isspace(), isalnum(), et al take an integer
argument representing an unsigned character, or -1 for EOF.  On
platforms with a signed char, it is unsafe to pass a char to them
without casting it to unsigned char first.

Most of git is already shielded against this by the ctype
implementation in git-compat-util.h, but xdiff, which uses libc
ctype.h, ought to be fixed.

Noticed-by: der Mouse <redacted>
Reported-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
xdiff/xmacros.h
xdiff/xmerge.c
xdiff/xutils.c
git clone https://git.99rst.org/PROJECT