Re: [Wireshark-dev] pcapng, must opt_commentstring?be?0-terminated?
Hi Chris, Thus wrote Chris Maynard (chris.mayn...@gtech.com): Martin Kaiser lists@... writes: I was wondering why we need a static buffer at all. It looks like the intention is to keep using the same buffer for each option that we parse. When reading an option, how about checking the length first and then allocating the buffer dynamically? We could then remove the g_strdup() as well and use the allocated buffer to pass the option on to wiretap etc. Your suggestion sounds good to me. My understandig is that g_strdup() allocates a copy that the caller must free. I don't think that at the moment, anybody is freeing the copy for the comment (or for any other option). If there's a leak, then that should be fixed. Care to open a bug report and submit a patch? sure, I'll look into this. I hope that at FOSDEM, we can discuss my proposed approach for getting the comment from pcapng-wiretap-capture_file, see https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3096 Once we've agreed on a way forward, I'll see how the g_strdup()s can be replaced. Best regards, Martin ___ Sent via:Wireshark-dev mailing list wireshark-dev@wireshark.org Archives:http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe
Re: [Wireshark-dev] pcapng, must opt_commentstring?be?0-terminated?
Martin Kaiser lists@... writes: I hope that at FOSDEM, we can discuss my proposed approach for getting the comment from pcapng-wiretap-capture_file, see https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3096 I won't be able to attend FOSDEM, but no matter; there will be far more talented core developers who will be attending with whom you can discuss this and other topics of interest with. To you and everyone attending, have a productive and enjoyable FOSDEM! - Chris ___ Sent via:Wireshark-dev mailing list wireshark-dev@wireshark.org Archives:http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe
Re: [Wireshark-dev] pcapng, must opt_commentstring be?0-terminated?
Martin Kaiser lists@... writes: I was wondering why we need a static buffer at all. It looks like the intention is to keep using the same buffer for each option that we parse. When reading an option, how about checking the length first and then allocating the buffer dynamically? We could then remove the g_strdup() as well and use the allocated buffer to pass the option on to wiretap etc. Your suggestion sounds good to me. My understandig is that g_strdup() allocates a copy that the caller must free. I don't think that at the moment, anybody is freeing the copy for the comment (or for any other option). If there's a leak, then that should be fixed. Care to open a bug report and submit a patch? - Chris ___ Sent via:Wireshark-dev mailing list wireshark-dev@wireshark.org Archives:http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe