Make sure the log buffer is initialized to a valid zero-length string.

ok Brad sthen@
This commit is contained in:
naddy 2011-08-01 20:50:10 +00:00
parent 4056123da3
commit 4c481ede43
2 changed files with 16 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.9 2011/04/05 08:09:00 sthen Exp $
# $OpenBSD: Makefile,v 1.10 2011/08/01 20:50:10 naddy Exp $
COMMENT= library and toolset to operate arrays of data
DISTNAME= orc-0.4.11
REVISION= 0
REVISION= 1
CATEGORIES= devel
MASTER_SITES= http://code.entropywave.com/download/orc/

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-orc_orcparse_c,v 1.1 2011/08/01 20:50:10 naddy Exp $
Make sure the log buffer starts out with a valid zero-length string.
--- orc/orcparse.c.orig Mon Aug 1 16:33:42 2011
+++ orc/orcparse.c Mon Aug 1 16:35:04 2011
@@ -71,6 +71,7 @@ orc_parse_full (const char *code, OrcProgram ***progra
parser->log = malloc(100);
parser->log_alloc = 100;
parser->log_size = 0;
+ parser->log[0] = 0;
while (parser->p[0] != 0) {
char *p;