From b156f4d03f6d3a65a59fe7d6f0217fca2c8fdf60 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Fri, 3 Dec 2010 14:13:43 -0500 Subject: [PATCH] freetdm: do not write to io dump if is not enabled --- libs/freetdm/src/ftdm_io.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index c43d694dee..495be78ff1 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -91,6 +91,10 @@ static void write_chan_io_dump(ftdm_channel_t *fchan, ftdm_io_dump_t *dump, char int windex = dump->windex; int avail = dump->size - windex; + if (!dump->buffer) { + return; + } + if (dlen > avail) { int diff = dlen - avail;