ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] reassemble.c r36131 fix comment

From: Jakub Zawadzki <darkjames@xxxxxxxxxxxxxxxx>
Date: Sun, 20 Mar 2011 23:34:57 +0100
Hi,

Trivial patch, len is already unsigned (guint32) so it can't be negative ;)

Cheers.
diff --git epan/reassemble.c epan/reassemble.c
index 3080997..574a0c2 100644
--- epan/reassemble.c
+++ epan/reassemble.c
@@ -966,7 +966,7 @@ fragment_add_work(fragment_data *fd_head, tvbuff_t *tvb, const int offset,
 						fd_i->len-(dfpos-fd_i->offset));
 				}
 			} else {
-				if (fd_i->offset + fd_i->len < fd_i->offset) /* XXX what? This only tests if fd_i->len is negative */
+				if (fd_i->offset + fd_i->len < fd_i->offset) /* Integer overflow? */
 					g_warning("Reassemble error in frame %u: offset %u + len %u < offset",
 						pinfo->fd->num, fd_i->offset,
 						fd_i->len);