diff options
author | 2014-11-25 10:26:07 +0000 | |
---|---|---|
committer | 2014-11-25 10:26:07 +0000 | |
commit | 031a04706e9d10d6fa6615a41f79cd96507ea2cb (patch) | |
tree | c6e8eddc027a8b55979a14522609bc964a8b23b4 /usr.bin/patch/common.h | |
parent | Prevent null pointer dereference on empty input files when diff requires (diff) | |
download | wireguard-openbsd-031a04706e9d10d6fa6615a41f79cd96507ea2cb.tar.xz wireguard-openbsd-031a04706e9d10d6fa6615a41f79cd96507ea2cb.zip |
Introduce strtolinenum to properly check line numbers while parsing:
no signs, no spaces, just digits, 0 <= x <= LONG_MAX
ok millert, otto
Diffstat (limited to 'usr.bin/patch/common.h')
-rw-r--r-- | usr.bin/patch/common.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/patch/common.h b/usr.bin/patch/common.h index 51649b1aad8..b20f6b21666 100644 --- a/usr.bin/patch/common.h +++ b/usr.bin/patch/common.h @@ -1,4 +1,4 @@ -/* $OpenBSD: common.h,v 1.27 2014/11/22 15:49:28 tobias Exp $ */ +/* $OpenBSD: common.h,v 1.28 2014/11/25 10:26:07 tobias Exp $ */ /* * patch - a program to apply diffs to original files @@ -28,6 +28,7 @@ #include <sys/types.h> +#include <limits.h> #include <stdbool.h> #define DEBUGGING @@ -38,6 +39,7 @@ #define INITHUNKMAX 125 /* initial dynamic allocation size */ #define MAXLINELEN 8192 #define BUFFERSIZE 1024 +#define LINENUM_MAX LONG_MAX #define RCSSUFFIX ",v" #define CHECKOUT "co -l %s" |