summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2014-11-25 10:22:09 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2014-11-25 10:22:09 +0000
commit9a6bf60fe3df67f9d584f6355cb46e8a966d2898 (patch)
treeec12b94fff5a6564c759b7b91951a4163671701e /usr.bin
parente3f36286d957c6c2a14bc2f9bb07bf3581d1b4d3 (diff)
Prevent null pointer dereference on empty input files when diff requires
a specific version. ok millert
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/patch/inp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/patch/inp.c b/usr.bin/patch/inp.c
index eddf723474d..760a9b307df 100644
--- a/usr.bin/patch/inp.c
+++ b/usr.bin/patch/inp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inp.c,v 1.40 2014/11/22 15:49:28 tobias Exp $ */
+/* $OpenBSD: inp.c,v 1.41 2014/11/25 10:22:08 tobias Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -303,7 +303,7 @@ plan_a(const char *filename)
/* now check for revision, if any */
if (revision != NULL) {
- if (!rev_in_string(i_womp)) {
+ if (i_womp == NULL || !rev_in_string(i_womp)) {
if (force) {
if (verbose)
say("Warning: this file doesn't appear "