ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] Build failure today

From: Martin Mathieson <martin.r.mathieson@xxxxxxxxxxxxxx>
Date: Fri, 20 Apr 2018 18:57:27 +0100
I'm getting the error below:

Looking at the first one, my compiler doesn't seem to realise that compute_offset()  will throw an exception rather than return a number without setting *offset_ptr

But when I look at e.g. BoundsError (which may be returned without setting *offset_ptr), it is #defined as 1 in epan/exceptions.h

Surely the returns in compute_offset() should be THROW() calls instead?

Martin


/home/martin/wireshark/epan/tvbuff.c: In function ‘tvb_captured_length_remaining’:
/home/martin/wireshark/epan/tvbuff.c:274:26: error: ‘abs_offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   *rem_len = tvb->length - *offset_ptr;
                          ^
/home/martin/wireshark/epan/tvbuff.c:499:8: note: ‘abs_offset’ was declared here
  guint abs_offset, rem_length;
        ^
/home/martin/wireshark/epan/tvbuff.c: In function ‘tvb_bytes_exist’:
/home/martin/wireshark/epan/tvbuff.c:325:13: error: ‘abs_offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  end_offset = *offset_ptr + *length_ptr;
             ^
/home/martin/wireshark/epan/tvbuff.c:550:8: note: ‘abs_offset’ was declared here
  guint abs_offset, abs_length;
        ^
/home/martin/wireshark/epan/tvbuff.c: In function ‘tvb_offset_exists’:
/home/martin/wireshark/epan/tvbuff.c:675:5: error: ‘abs_offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  if (abs_offset < tvb->length) {
     ^
/home/martin/wireshark/epan/tvbuff.c: In function ‘tvb_reported_length_remaining’:
/home/martin/wireshark/epan/tvbuff.c:704:31: error: ‘abs_offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   return tvb->reported_length - abs_offset;