]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
wireshark: Drop needless comment in dissect_xdr_bytes()
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 29 Nov 2021 09:20:05 +0000 (10:20 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 29 Nov 2021 14:05:43 +0000 (15:05 +0100)
In the dissect_xdr_bytes() there's a comment that the string
allocated by xdr_bytes() can't be freed using xdr_free(). Well,
that is expected because xdr_bytes() used plain calloc() AND the
string is not an XDR struct but plain 'char *' type. Passing it
to xdr_free() must result in weird things happening.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
tools/wireshark/src/packet-libvirt.c

index cb922b8070c303cc113b166e7caf940b6bfebe11..eeacbcdf0e14a621d2e3624a42e3aea5b0d7804b 100644 (file)
@@ -195,8 +195,6 @@ dissect_xdr_bytes(tvbuff_t *tvb, proto_tree *tree, XDR *xdrs, int hf,
         const char *s = tvb_bytes_to_str(wmem_packet_scope(), tvb, start, len);
 
         proto_tree_add_bytes_format_value(tree, hf, tvb, start, len, NULL, "%s", s);
-        /* Seems I can't call xdr_free() for this case.
-           It will raises SEGV by referencing out of bounds call stack */
         free(val);
         return TRUE;
     } else {