From: Russell Bryant Date: Tue, 18 Jul 2006 00:41:47 +0000 (+0000) Subject: don't crash if the frame has no data, but has a src X-Git-Tag: 1.2.11~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b97c12b80bd0ad6106bf646f705a5c63355ab980;p=thirdparty%2Fasterisk.git don't crash if the frame has no data, but has a src git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@37856 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/frame.c b/frame.c index 2a7ee86105..2b504399d0 100644 --- a/frame.c +++ b/frame.c @@ -392,7 +392,7 @@ struct ast_frame *ast_frdup(struct ast_frame *f) memcpy(out->data, f->data, out->datalen); } if (srclen > 0) { - out->src = out->data + f->datalen; + out->src = buf + sizeof(*out) + AST_FRIENDLY_OFFSET + f->datalen; /* Must have space since we allocated for it */ strcpy((char *)out->src, f->src); }