From 91ed09bcb28d51cdc9cc447ffac6d3f3c566cda8 Mon Sep 17 00:00:00 2001 From: Dan Talayco Date: Thu, 3 Jun 2010 10:13:46 -0700 Subject: [PATCH] Trac 97: Fixed seg fault on decode The packet type is signed and was not bounds-checked for being negative. --- utilities/wireshark_dissectors/openflow/packet-openflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/wireshark_dissectors/openflow/packet-openflow.c b/utilities/wireshark_dissectors/openflow/packet-openflow.c index 2532a69..d23d6c4 100644 --- a/utilities/wireshark_dissectors/openflow/packet-openflow.c +++ b/utilities/wireshark_dissectors/openflow/packet-openflow.c @@ -1947,7 +1947,7 @@ void proto_register_openflow() const char* ofp_type_to_string( gint8 type ) { static char str_unknown[17]; - if( type <= OFP_TYPE_MAX_VALUE ) + if(( type <= OFP_TYPE_MAX_VALUE ) && (type >= 0)) return names_ofp_type[type].strptr; else { snprintf( str_unknown, 17, "Unknown Type %u", type );