From 0e43a2bcc0b044ec8e92108811c1341076938af9 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 22 Dec 2004 00:15:34 +0000 Subject: 2004-12-21 Paul Jakma * stream.c: Dont allocate streams with 0 sized data buffers --- lib/stream.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/stream.c') diff --git a/lib/stream.c b/lib/stream.c index 2d4de760..1b85b130 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -46,6 +46,11 @@ stream_new (size_t size) { struct stream *s; + assert (size > 0); + + if (size == 0) + return NULL; + s = XCALLOC (MTYPE_STREAM, sizeof (struct stream)); s->data = XCALLOC (MTYPE_STREAM_DATA, size); -- cgit v1.2.1