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
..
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-30 12:52:33 +00:00
2014-07-08 22:27:50 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-02-08 13:29:35 +00:00
2014-11-27 01:37:01 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-06-10 06:16:34 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2013-11-21 21:19:01 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-07-07 00:27:09 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2012-09-14 17:50:42 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2012-11-17 23:52:38 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-07-04 04:47:29 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-05-11 02:04:40 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-30 12:52:33 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2013-09-20 16:05:09 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2013-03-17 06:36:04 +00:00
2011-11-06 08:16:35 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2013-01-14 11:06:50 +00:00
2014-11-25 14:29:10 +00:00
2014-11-30 12:52:33 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2013-04-23 13:03:17 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2013-11-20 17:48:38 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-29 06:53:06 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2012-10-07 20:01:41 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2014-11-25 14:29:10 +00:00
2013-03-07 23:44:35 +00:00