From d620b00ffa4f68a9592059dfb736f9c93612126b Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Fri, 19 Oct 2007 15:09:31 +0000 Subject: [PATCH] * src/Makefile.am: fix tst build rule * src/buf.c: fix virBufferContentAndFree to make sure the string is always 0 terminated. Daniel --- ChangeLog | 6 ++++++ src/Makefile.am | 2 +- src/buf.c | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c52e6f7f0..35128a36ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Oct 19 17:08:08 CEST 2007 Daniel Veillard + + * src/Makefile.am: fix tst build rule + * src/buf.c: fix virBufferContentAndFree to make sure the string is + always 0 terminated. + Fri Oct 19 11:59:39 CEST 2007 Daniel Veillard * src/conf.c: fix bug on negative values in virConfParseLong() diff --git a/src/Makefile.am b/src/Makefile.am index 4a250a8a17..e2d61645a8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -77,7 +77,7 @@ virsh_CFLAGS = $(COVERAGE_CFLAGS) # target to ease building test programs # tst: tst.c - $(CC) $(CFLAGS) -I../include -o tst tst.c .libs/libvirt.a -lxml2 -lxenstore -lpthread + $(CC) $(CFLAGS) $(INCLUDES) -I../include -o tst tst.c .libs/libvirt.a -lxml2 -lxenstore -lpthread COVERAGE_FILES = $(CLIENT_SOURCES:%.c=libvirt_la-%.cov) diff --git a/src/buf.c b/src/buf.c index 192f064401..02523575b4 100644 --- a/src/buf.c +++ b/src/buf.c @@ -141,9 +141,11 @@ virBufferContentAndFree (virBufferPtr buf) return(NULL); content = buf->content; + if (content != NULL) + content[buf->use] = 0; free (buf); - return content; + return(content); } /** -- GitLab