aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-08-06 10:34:53 +0200
committerPeter Wu <peter@lekensteyn.nl>2018-08-06 10:27:41 +0000
commite1d144e4711a376737b6487012fc720e279396a9 (patch)
tree1ee1fd2548429741eb555d2533be0928cd4c5b6a /epan/tvbuff.c
parent3d07f6f512ac0fa0cc8431e29ae009cca4bbbe61 (diff)
tvbuff: add assertion to tvb_skip_wsp_return().
Minor indentation fixes. Change-Id: I0b22b1b247efc4f1db535eb1f7cb7e99c3637ba0 Reviewed-on: https://code.wireshark.org/review/28981 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 2711b8e202..e40401075a 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -3645,14 +3645,18 @@ tvb_skip_wsp(tvbuff_t *tvb, const gint offset, const gint maxlength)
}
gint
-tvb_skip_wsp_return(tvbuff_t *tvb, const gint offset) {
+tvb_skip_wsp_return(tvbuff_t *tvb, const gint offset)
+{
gint counter = offset;
guint8 tempchar;
- for(counter = offset; counter > 0 &&
+ DISSECTOR_ASSERT(tvb && tvb->initialized);
+
+ for (counter = offset; counter > 0 &&
((tempchar = tvb_get_guint8(tvb,counter)) == ' ' ||
tempchar == '\t' || tempchar == '\n' || tempchar == '\r'); counter--);
counter++;
+
return (counter);
}