1
0
forked from aniani/vim
Keith Thompson 184f71cc68
patch 9.1.0006: is*() and to*() function may be unsafe
Problem:  is*() and to*() function may be unsafe
Solution: Add SAFE_* macros and start using those instead
          (Keith Thompson)

Use SAFE_() macros for is*() and to*() functions

The standard is*() and to*() functions declared in <ctype.h> have
undefined behavior for negative arguments other than EOF.  If plain char
is signed, passing an unchecked value from argv for from user input
to one of these functions has undefined behavior.

Solution: Add SAFE_*() macros that cast the argument to unsigned char.

Most implementations behave sanely for negative arguments, and most
character values in practice are non-negative, but it's still best
to avoid undefined behavior.

The change from #13347 has been omitted, as this has already been
separately fixed in commit ac709e2fc0db6d31abb7da96f743c40956b60c3a
(v9.0.2054)

fixes: #13332
closes: #13347

Signed-off-by: Keith Thompson <Keith.S.Thompson@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-04 21:19:04 +01:00
..
2016-06-12 23:01:46 +02:00
2018-05-06 17:57:30 +02:00
2018-11-04 14:45:49 +01:00
2022-03-19 15:18:53 +00:00
2004-06-13 20:20:40 +00:00
2004-06-13 20:20:40 +00:00
2012-07-25 17:49:10 +02:00
2020-12-10 21:11:27 +01:00
2004-06-13 20:20:40 +00:00
2004-06-13 20:20:40 +00:00
2004-06-13 20:20:40 +00:00
ref
2004-06-13 20:20:40 +00:00
2021-07-28 20:10:16 +02:00
2019-11-30 17:57:03 +01:00
2004-06-13 20:20:40 +00:00
2016-09-22 22:33:02 +02:00
2008-08-06 17:06:04 +00:00
2008-08-06 17:06:04 +00:00
2004-06-13 20:20:40 +00:00

Some tools that can be used with Vim:

blink.c:	C program to make the cursor blink in an xterm.

ccfilter*:	C program to filter the output of a few compilers to a common
		QuickFix format.

efm_filter.*:	Perl script to filter compiler messages to QuickFix format.

efm_perl.pl:	Perl script to filter error messages from the Perl interpreter
		for use with Vim quickfix mode.

mve.*		Awk script to filter error messages to QuickFix format.

pltags.pl:	Perl script to create a tags file from Perl scripts.

ref:		Shell script for the K command.

shtags.*:	Perl script to create a tags file from a shell script.

vim132:		Shell script to edit in 132 column mode on vt100 compatible
		terminals.

vimm:		Shell script to start Vim on a DEC terminal with mouse
		enabled.

vimspell.*:	Shell script for highlighting spelling mistakes.

vim_vs_net.cmd: MS-Windows command file to use Vim with MS Visual Studio 7 and
		later.

xcmdsrv_client.c:  Example for a client program that communicates with a Vim
		   server through the X-Windows interface.

unicode.vim	Vim script to generate tables for src/mbyte.c.

[xxd can be found in the src directory]