This fixes a high fence violation that MALLOC_DEBUG reported to me.
authorRussell Bryant <russell@russellbryant.com>
Mon, 31 Mar 2008 16:37:13 +0000 (16:37 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 31 Mar 2008 16:37:13 +0000 (16:37 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111996 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index e7e0e92..5badfc7 100644 (file)
@@ -8313,7 +8313,7 @@ static void copy_request(struct sip_request *dst, const struct sip_request *src)
 
        if (!dst->data && !(dst->data = ast_str_create(src->data->used + 1)))
                return;
-       else if (dst->data->len < src->data->used)
+       else if (dst->data->len < src->data->used + 1)
                ast_str_make_space(&dst->data, src->data->used + 1);
                
        memcpy(dst->data->str, src->data->str, src->data->used + 1);