diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-03-22 21:47:11 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-03-22 21:47:11 +0000 |
commit | b955abc3edb75513c2e82a08dbcc9a9396d14c70 (patch) | |
tree | fe85126309eb4af7ebf65d03ad708531d4dd9916 | |
parent | cf7dee822b7af48131bd9565ab1036e5c7fa0a2d (diff) |
bugfix for buildbot randpkt: don't call proto_tree_add_string with a NULL pointer
TO THE DISSECTOR DEVELOPERS, PLEASE FIX THIS: I could easily found several places where a g_assert is called, depending on the input packet data. NEVER DO THIS, as this crashes Ethereal simply by invalid packet data input!!!
svn path=/trunk/; revision=13868
-rw-r--r-- | epan/dissectors/packet-wsp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c index f194e5e657..f6bc6cedce 100644 --- a/epan/dissectors/packet-wsp.c +++ b/epan/dissectors/packet-wsp.c @@ -3734,11 +3734,13 @@ static guint32 wkh_te (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packe } } else { /* TE in Token-text format */ get_token_text(val_str, tvb, off, len, ok); - ti = proto_tree_add_string(tree, hf_hdr_te, - tvb, hdr_start, off - hdr_start, val_str); - g_free(val_str); - off += len; - ok = TRUE; + if(ok) { + ti = proto_tree_add_string(tree, hf_hdr_te, + tvb, hdr_start, off - hdr_start, val_str); + g_free(val_str); + off += len; + ok = TRUE; + } } if ((ok) && (off < offset)) { /* Q-token Q-value */ /* TODO */ |