1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-26 11:47:31 +00:00
freebsd/usr.bin/patch
Pedro F. Giffuni d3fc0cb884 patch(1): avoid line number overflows
Introduce strtolinenum to properly check line numbers while parsing:
no signs, no spaces, just digits, 0 <= x <= LONG_MAX

Properly validate line ranges supplied in diff file to prevent overflows.
Also fixes an out of boundary memory access because the resulting values
are used as array indices.

PR:	195436
Obtained from:	OpenBSD (CVS pch.c rev 1.45, 1,46, common.h rev 1.28)
MFC after:	1 week
2014-12-08 15:10:48 +00:00
..
backupfile.c
backupfile.h
common.h patch(1): avoid line number overflows 2014-12-08 15:10:48 +00:00
inp.c
inp.h
Makefile Drop build option switch for the older GNU patch. 2013-08-29 00:38:24 +00:00
mkpath.c
patch.1 patch: add dry-run alias for compatibility with other implementations. 2014-06-15 16:38:17 +00:00
patch.c Prefer setvbuf() to setlinebuf(). 2014-12-07 20:15:07 +00:00
pathnames.h
pch.c patch(1): avoid line number overflows 2014-12-08 15:10:48 +00:00
pch.h patch: unsign the line length to avoid overflows. 2014-06-15 03:54:23 +00:00
util.c Improve bsdpatch usability: 2013-09-26 18:00:45 +00:00
util.h