aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2012-03-31 12:35:07 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2012-03-31 12:35:07 +0000
commit35eae4549756b8cd8cad45121f2b992340355d85 (patch)
treed2d187317954bd6f20a1bd718367f1f527322d65 /epan/tvbuff.c
parent60f47ed05b904eabfe07cddd38e8ab52714146c5 (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.c7
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;