summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/rcsparse.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2014-11-22 15:51:41 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2014-11-22 15:51:41 +0000
commitaa3b6d07c8d282936d829c98280316484de11601 (patch)
tree16932a9e28bf331aa7d15e6103fdf39cff718b4f /usr.bin/cvs/rcsparse.c
parentcbc6b8c5954aa056a66280a462b292f203ebbd64 (diff)
Fixed uninitialized pointer (and other struct entries while at it)
which is referenced while parsing invalid RCS files. Spotted by jsg. ok deraadt
Diffstat (limited to 'usr.bin/cvs/rcsparse.c')
-rw-r--r--usr.bin/cvs/rcsparse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cvs/rcsparse.c b/usr.bin/cvs/rcsparse.c
index 0c615eef0ce..a8eca4de26a 100644
--- a/usr.bin/cvs/rcsparse.c
+++ b/usr.bin/cvs/rcsparse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsparse.c,v 1.8 2014/11/16 19:14:34 bluhm Exp $ */
+/* $OpenBSD: rcsparse.c,v 1.9 2014/11/22 15:51:40 tobias Exp $ */
/*
* Copyright (c) 2010 Tobias Stoeckmann <tobias@openbsd.org>
*
@@ -224,7 +224,7 @@ rcsparse_init(RCSFILE *rfp)
if (rfp->rf_flags & RCS_PARSED)
return (0);
- pdp = xmalloc(sizeof(*pdp));
+ pdp = xcalloc(sizeof(*pdp));
pdp->rp_buf = xmalloc(RCS_BUFSIZE);
pdp->rp_blen = RCS_BUFSIZE;
pdp->rp_bufend = pdp->rp_buf + pdp->rp_blen - 1;