diff --git a/epan/strutil.c b/epan/strutil.c index 8d92a2c2ac6..cda85c5bb62 100644 --- a/epan/strutil.c +++ b/epan/strutil.c @@ -339,16 +339,15 @@ hex_str_to_bytes_encoding(const gchar *hex_str, GByteArray *bytes, const gchar * if (fail_if_partial) retval = FALSE; break; } - ++end; - d = str_to_nibble[(guchar)*end]; + d = str_to_nibble[(guchar)*(end+1)]; if (d < 0) { if (fail_if_partial) retval = FALSE; break; } val = ((guint8)c * 16) + d; g_byte_array_append(bytes, &val, 1); - ++end; + end += 2; /* check for separator and peek at next char to make sure we should keep going */ if (sep > 0 && *end == sep && str_to_nibble[(guchar)*(end+1)] > -1) { diff --git a/epan/tvbuff.c b/epan/tvbuff.c index c849e2558dd..be23e3408f4 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -1748,7 +1748,7 @@ tvb_get_string_bytes(tvbuff_t *tvb, const gint offset, const gint length, ptr = (gchar*) tvb_get_raw_string(NULL, tvb, offset, length); begin = ptr; - if (endoff) *endoff = 0; + if (endoff) *endoff = offset; while (*begin == ' ') begin++;