summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-10-24 06:22:54 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-10-24 06:22:54 +0000
commita60457e2d398cf41236f7c890db3225b4e923432 (patch)
tree235e0d2874f9984f4ded12a8d53ed2c733cc5e39 /usr.bin/cvs
parentdfec78c060b98b43a0e3ae824c5c6b7bcc10c98e (diff)
Check that string length != 0 before setting buf[strlen(buf) - 1].
OK xsa@.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/diff3.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c
index d02d6f649ee..b96b2497f76 100644
--- a/usr.bin/cvs/diff3.c
+++ b/usr.bin/cvs/diff3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3.c,v 1.26 2006/07/08 09:25:44 ray Exp $ */
+/* $OpenBSD: diff3.c,v 1.27 2006/10/24 06:22:53 ray Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -72,7 +72,7 @@ static const char copyright[] =
#ifndef lint
static const char rcsid[] =
- "$OpenBSD: diff3.c,v 1.26 2006/07/08 09:25:44 ray Exp $";
+ "$OpenBSD: diff3.c,v 1.27 2006/10/24 06:22:53 ray Exp $";
#endif /* not lint */
#include "includes.h"
@@ -315,6 +315,8 @@ ed_patch_lines(struct cvs_lines *dlines, struct cvs_lines *plines)
end = 0;
for (lp = TAILQ_NEXT(lp, l_list); lp != NULL;
lp = TAILQ_NEXT(lp, l_list)) {
+ if (lp->l_line[0] == '\0')
+ fatal("ed_patch_lines");
op = lp->l_line[strlen(lp->l_line) - 1];
start = (int)strtol(lp->l_line, &ep, 10);
if (op == 'a') {