diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2012-03-31 12:35:07 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2012-03-31 12:35:07 +0000 |
commit | 35eae4549756b8cd8cad45121f2b992340355d85 (patch) | |
tree | d2d187317954bd6f20a1bd718367f1f527322d65 /epan/tvbuff.c | |
parent | 60f47ed05b904eabfe07cddd38e8ab52714146c5 (diff) |
These buffers in tvb_uncompress() can't ovelaps, so use optimized memcpy().
svn path=/trunk/; revision=41870
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r-- | epan/tvbuff.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index 4cb743371d..ea9d3fe405 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -3323,15 +3323,14 @@ tvb_uncompress(tvbuff_t *tvb, const int offset, int comprlen) * when uncompr is NULL logic below doesn't create tvb * which is later interpreted as decompression failed. */ - uncompr = (bytes_pass || ret != Z_STREAM_END) ? + uncompr = (bytes_pass || err != Z_STREAM_END) ? g_memdup(strmbuf, bytes_pass) : g_strdup(""); } else { guint8 *new_data = g_malloc0(bytes_out + bytes_pass); - g_memmove(new_data, uncompr, bytes_out); - g_memmove((new_data + bytes_out), strmbuf, - bytes_pass); + memcpy(new_data, uncompr, bytes_out); + memcpy(new_data + bytes_out, strmbuf, bytes_pass); g_free(uncompr); uncompr = new_data; |