diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2006-03-12 16:42:10 +0000 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2006-03-12 16:42:10 +0000 |
commit | 20707c71eccee1185f66610297986beb53814a29 (patch) | |
tree | abebb5e16da8095f2b8b32fe0cccd87b9d6e555f /epan/expert.c | |
parent | 25ff5cd7875540ffaf09ba345ba5aaa4a062edb9 (diff) | |
download | wireshark-20707c71eccee1185f66610297986beb53814a29.tar.gz |
Assure that pinfo is a valid pointer. Related to Coverity CID 112
svn path=/trunk/; revision=17601
Diffstat (limited to 'epan/expert.c')
-rw-r--r-- | epan/expert.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/expert.c b/epan/expert.c index 9382fbaa3e..06f1719097 100644 --- a/epan/expert.c +++ b/epan/expert.c @@ -77,7 +77,7 @@ packet_info *pinfo, proto_item *pi, int group, int severity, const char *format, /* if this packet isn't loaded because of a read filter, don't output anything */ - if(pinfo->fd->num == 0) { + if(pinfo == NULL || pinfo->fd->num == 0) { return; } @@ -87,7 +87,7 @@ packet_info *pinfo, proto_item *pi, int group, int severity, const char *format, formatted[sizeof(formatted) - 1] = '\0'; ei = ep_alloc(sizeof(expert_info_t)); - ei->packet_num = pinfo ? pinfo->fd->num : 0; + ei->packet_num = pinfo->fd->num; ei->group = group; ei->severity = severity; ei->protocol = ep_strdup(pinfo->current_proto); |