Fix Coverity CID 973548: Dereference null return value.
authorChris Maynard <Christopher.Maynard@GTECH.COM>
Fri, 8 Feb 2013 16:23:02 +0000 (16:23 -0000)
committerChris Maynard <Christopher.Maynard@GTECH.COM>
Fri, 8 Feb 2013 16:23:02 +0000 (16:23 -0000)
#BACKPORT(1.8, 1.6)

svn path=/trunk/; revision=47568

ui/gtk/main.c

index 1823c7e9671c24f7e52b96fbe5cea9e1c54a28aa..4773863cee4d7fd132bcb09204f06e375d40fae6 100644 (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]);