Assure that pinfo is a valid pointer. Related to Coverity CID 112

svn path=/trunk/; revision=17601
This commit is contained in:
Jaap Keuter 2006-03-12 16:42:10 +00:00
parent 25ff5cd787
commit 20707c71ec
1 changed files with 2 additions and 2 deletions

View File

@ -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);