Wireshark-dev: Re: [Wireshark-dev] FW: [Wireshark-commits] rev 52730: /trunk/epan/dissectors/ /
From: Jakub Zawadzki <[email protected]>
Date: Mon, 21 Oct 2013 22:52:27 +0200
Hi,

> User: eapache
> Date: 2013/10/21 01:07 PM
> 
> Log:
>  Don't go into a loop if we find a zero-length line. Fixes
>  https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9312
>  
>  Anders, this may be related to your recent TVB optimizations, since I don't  think it happened before that? Did you change the behaviour of tvb_find_line_end  or its callees at all?

>From tvb_find_line_end() comment:

 * Set "*next_offset" to the (...) past the end of the buffer if we don't find a line terminator. 

This was changed, tvb_find_line_end() no longer does it, it sets *next_offset to tvb->length, so there's no exception in next call.

I'm also not happy about:

2481                                 /* tvb_get_guint8() */
2482                                 ptr=tvb->real_data + eol_offset + 1;

If it really speedup dissection there should be at least DISSECTOR_ASSERT(tvb->real_data != NULL) before.

Cheers,
Kuba.