Fix Bug 9915 'GIOP dissector prints non-UTF-8 to Info column'

When the capture file in Bug 9915 is opened in wireshark with GTK2,
the console prints out 'Pango-WARNING **: Invalid UTF-8' warnings.
This capture file was a subset of the one in fuzzbot crash bug 9883.
I believe it is what's causing the crash in 9883, because GTK is
finicky about such things. But my system doesn't crash for bug 9883,
so perhaps it's not the same root cause.

Change-Id: Ifaaed9157f9abd34014001c954647f7db51d650b
Reviewed-on: https://code.wireshark.org/review/786
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Hadriel Kaplan 2014-03-22 10:27:33 -04:00 committed by Alexis La Goutte
parent 4acdfe3e63
commit 1f28f472c8
1 changed files with 5 additions and 2 deletions

View File

@ -291,6 +291,7 @@
#include <epan/wmem/wmem.h>
#include <epan/prefs.h>
#include <epan/expert.h>
#include <epan/strutil.h>
#include "packet-giop.h"
#include "packet-ziop.h"
@ -3321,6 +3322,8 @@ guint32 get_CDR_string(tvbuff_t *tvb, const gchar **seq, int *offset, gboolean s
*seq = wmem_strdup(wmem_packet_scope(), ""); /* zero-length string */
}
/* XXX: this returns a length which is only known to be less than reported_length_remaining,
but it could still be more than captured length, no? */
return slength; /* return length */
}
@ -4356,7 +4359,7 @@ dissect_giop_request_1_1 (tvbuff_t * tvb, packet_info * pinfo,
if ( len > 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ": op=%s", operation);
col_append_fstr(pinfo->cinfo, COL_INFO, ": op=%s", format_text(operation, (size_t)len));
proto_tree_add_string(request_tree, hf_giop_req_operation, tvb, offset - len, len, operation);
}
@ -4481,7 +4484,7 @@ dissect_giop_request_1_2 (tvbuff_t * tvb, packet_info * pinfo,
if ( len > 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ": op=%s", operation);
col_append_fstr(pinfo->cinfo, COL_INFO, ": op=%s", format_text(operation, (size_t)len));
proto_tree_add_string(request_tree, hf_giop_req_operation, tvb, offset - len, len, operation);
}