From f65a70eb4bb096ee0ad4eea1c0f5a80bebc495e7 Mon Sep 17 00:00:00 2001 From: Niall O'Higgins Date: Mon, 4 Dec 2006 03:53:31 +0000 Subject: - fix crash when doing keyword expansion of zero-length buffers. ok ray@ --- usr.bin/cvs/rcs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.bin') diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index f3c4995be6a..4a43c9aaeda 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.188 2006/08/23 20:28:00 joris Exp $ */ +/* $OpenBSD: rcs.c,v 1.189 2006/12/04 03:53:30 niallo Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -2595,6 +2595,8 @@ rcs_expand_keywords(char *rcsfile, struct rcs_delta *rdp, BUF *bp, int mode) kwstr = NULL; len = cvs_buf_len(bp); + if (len == 0) + return (bp); c = cvs_buf_get(bp); found = 0; -- cgit v1.2.3