freebsd-skq/usr.bin/patch
pfg 7cc43d5ff8 MFC r275553, r275612;
patch(1): Bring fixes from OpenBSD

Check fstat return value.  Use off_t for file size and offsets.
Avoid iterating over end of string.

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
2014-12-16 21:13:55 +00:00
..
backupfile.c
backupfile.h
common.h MFC r275553, r275612; 2014-12-16 21:13:55 +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 MFC r267512: 2014-06-22 20:29:51 +00:00
patch.c MFC r275531, r275581, r275582; 2014-12-16 21:05:28 +00:00
pathnames.h
pch.c MFC r275553, r275612; 2014-12-16 21:13:55 +00:00
pch.h MFC r267490: 2014-06-22 20:24:17 +00:00
util.c Improve bsdpatch usability: 2013-09-26 18:00:45 +00:00
util.h