Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 6878] Overhaul of tvb_get_bitsxx() functions

Date: Tue, 28 Feb 2012 00:24:39 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6878

--- Comment #1 from Anders Broman <anders.broman@xxxxxxxxxxxx> 2012-02-28 00:24:36 PST ---
Looks good but something is not right here:
+           else if (remaining_bit_length < 32)
+           {
+                 /* 16 - 31 bits */
+                 value <<= 16;
+                 value += tvb_get_ntohs(tvb, octet_offset);
+                 remaining_bit_length -= 16;
+                 octet_offset += 2;
+           }
+           else if (remaining_bit_length < 32)   <--- 64?
+           {
+                 /* 32 - 64 bits */
+                 value <<= 32;
+                 value += tvb_get_ntohl(tvb, octet_offset);
+                 remaining_bit_length -= 32;
+                 octet_offset += 4;
+           }
+           else
+           {
+                 /* 64 bits */
+                 value <<= 64;                    <--- Not needed? same as = 0

Perhaps it's as easy just to loop over tvb_get_guint8() till the bits are
consumed.
Regards
Anders

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.