Fix Coverity CID 973548: Dereference null return value.

#BACKPORT(1.8, 1.6)


svn path=/trunk/; revision=47568
This commit is contained in:
Chris Maynard 2013-02-08 16:23:02 +00:00
parent 7ffa55c84e
commit 73b49715c9
1 changed files with 2 additions and 2 deletions

View File

@ -604,10 +604,10 @@ get_filter_from_packet_list_row_and_column(gpointer data)
/* leak a little but safer than ep_ here */
if (cfile.cinfo.col_fmt[column] == COL_CUSTOM) {
header_field_info *hfi = proto_registrar_get_byname(cfile.cinfo.col_custom_field[column]);
if (hfi->parent == -1) {
if (hfi && hfi->parent == -1) {
/* Protocol only */
buf = se_strdup(cfile.cinfo.col_expr.col_expr[column]);
} else if (hfi->type == FT_STRING) {
} else if (hfi && hfi->type == FT_STRING) {
/* Custom string, add quotes */
buf = se_strdup_printf("%s == \"%s\"", cfile.cinfo.col_expr.col_expr[column],
cfile.cinfo.col_expr.col_expr_val[column]);