diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-06-11 18:59:25 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-06-12 01:59:54 +0000 |
commit | 24f02dafcd80a10558bf5afeed07a0989a6d7cc6 (patch) | |
tree | f8c040d6f41a60db18444eada5496c8461500871 /ui/gtk | |
parent | 4cab0516cc1108b2a9538702ea105bb6053a425f (diff) |
Add checks to address setting routines.
Fail if:
1) you have an AT_NONE address with data;
2) you have a non-AT_NONE address with a zero length and a
non-null data pointer, or with a non-zero length and a null
data pointer.
When comparing addresses for equality, just make sure the types are the
same, the lengths are the same and, if the lengths are non-zero, the
data is the same; don't treat AT_NONE specially - the "lengths are
non-zero" check will make sure we do the right thing.
Make sure when we create an AT_NONE address it has a zero length and
null data pointer.
Change-Id: I5c452ef0d140c2d9aef3004f1cfd124a95b78fb2
Reviewed-on: https://code.wireshark.org/review/15839
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/gtk')
-rw-r--r-- | ui/gtk/graph_analysis.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ui/gtk/graph_analysis.c b/ui/gtk/graph_analysis.c index d6351f6d6b..43c15d47de 100644 --- a/ui/gtk/graph_analysis.c +++ b/ui/gtk/graph_analysis.c @@ -106,9 +106,7 @@ static void graph_analysis_init_dlg(graph_analysis_data_t *user_data) user_data->on_destroy_user_data = NULL; user_data->data = NULL; for (i=0; i<MAX_NUM_NODES; i++) { - user_data->graph_info->nodes[i].type = AT_NONE; - user_data->graph_info->nodes[i].len = 0; - user_data->graph_info->nodes[i].data = NULL; + clear_address(&user_data->graph_info->nodes[i]); } user_data->dlg.first_node = 0; |