There's no need to call tvb_get_ptr() in here: just call ensure_contiguous() directly.
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 12 Jan 2011 20:25:36 +0000 (20:25 +0000)
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 12 Jan 2011 20:25:36 +0000 (20:25 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35509 f5534014-38df-0310-8fa8-9805f1628bb7

epan/tvbuff.c

index 82488c9c241c02521dceebfa2001ffd7d7a92757..69d3ac4fc7e556bee057b570b90b9f34eac9c9cd 100644 (file)
@@ -2452,7 +2452,7 @@ tvb_get_const_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp)
        const guint8 *strptr;
 
        size = tvb_strsize(tvb, offset);
-       strptr = tvb_get_ptr(tvb, offset, size);
+       strptr = ensure_contiguous(tvb, offset, size);
        if (lengthp)
                *lengthp = size;
        return strptr;
@@ -3020,7 +3020,7 @@ gint tvb_skip_wsp_return(tvbuff_t* tvb, const gint offset){
 gchar *
 tvb_bytes_to_str_punct(tvbuff_t *tvb, const gint offset, const gint len, const gchar punct)
 {
-       return bytes_to_str_punct(tvb_get_ptr(tvb, offset, len), len, punct);
+       return bytes_to_str_punct(ensure_contiguous(tvb, offset, len), len, punct);
 }
 
 
@@ -3095,7 +3095,7 @@ tvb_bcd_dig_to_ep_str(tvbuff_t *tvb, const gint offset, const gint len, dgt_set_
 gchar *
 tvb_bytes_to_str(tvbuff_t *tvb, const gint offset, const gint len)
 {
-       return bytes_to_str(tvb_get_ptr(tvb, offset, len), len);
+       return bytes_to_str(ensure_contiguous(tvb, offset, len), len);
 }
 
 /* Find a needle tvbuff within a haystack tvbuff. */
@@ -3115,8 +3115,8 @@ tvb_find_tvb(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb, const gint haystack_o
        }
 
        /* Get pointers to the tvbuffs' data. */
-       haystack_data = tvb_get_ptr(haystack_tvb, 0, -1);
-       needle_data = tvb_get_ptr(needle_tvb, 0, -1);
+       haystack_data = ensure_contiguous(haystack_tvb, 0, -1);
+       needle_data = ensure_contiguous(needle_tvb, 0, -1);
 
        check_offset_length(haystack_tvb->length, haystack_tvb->reported_length, haystack_offset, -1,
                        &haystack_abs_offset, &haystack_abs_length);