Guy,
In revision 1.5 of gtk/tcp_graph.c, you changed it in the following
way:
- tcp = (struct tcphdr * )((char * )ip + 4*IHL(ip));
+ tcp = (struct tcphdr * )(ip + 4*IHL((struct iphdr *)ip));
and eliminated the cast for the first occurrence of 'ip'. Is there any
intention for this change? Since 'ip' here is a pointer to void
(i.e. void *ip;), MSVC (and possibly other compilers also) will
complain because the compiler can't calculate the size of (*ip), while
gcc doesn't complain and increment the 'ip' as we expect. Gcc's
behavior may be defined by ANSI or the sort, but, for portability
reason, we'd better cast it anyway to an appropriate type, wouldn't
we? I think casting it to (guint8 *) is more appropriate than casting
it to (char *) in this case. Enclosed is my proposed patch. This will
make it compile under Win32.
Regards,
=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=
+----+----+
|.. .| | Motonori Shindo
|_~__| |
| .. |~~_~| Sr. Systems Engineer
| . | | CoSine Communications Inc.
+----+----+
C o S i n e e-mail: mshindo@xxxxxxxxxxxxx
Communications
=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=
Index: gtk/tcp_graph.c
===================================================================
RCS file: /cvsroot/ethereal/gtk/tcp_graph.c,v
retrieving revision 1.8
diff -u -r1.8 tcp_graph.c
--- tcp_graph.c 2001/12/10 23:27:25 1.8
+++ tcp_graph.c 2001/12/11 11:00:57
@@ -1818,7 +1818,7 @@
/* printf ("transport protocol not TCP: %#1x\n", ip->protocol); */
return FALSE;
}
- tcp = (struct tcphdr * )(ip + 4*IHL((struct iphdr *)ip));
+ tcp = (struct tcphdr * )((guint8 *)ip + 4*IHL((struct iphdr *)ip));
memcpy(&hdrs->iphdr, ip, sizeof (struct iphdr));
memcpy(&hdrs->tcphdr, tcp, sizeof (struct tcphdr));
This message has been 'sanitized'. This means that potentially
dangerous content has been rewritten or removed. The following
log describes which actions were taken.
Sanitizer (start="1008070628"):
Replaced MIME boundary: >>--Next_Part--<<
with: >>MIMEStream=_0+65187_91917874857665_94550395384<<
Writer (pos="1043"):
Total modifications so far: 1
Part (pos="1089"):
SanitizeFile (filename="unnamed.txt", mimetype="Text/Plain"):
Match (rule="2"):
Enforced policy: accept
Part (pos="2406"):
SanitizeFile (filename="void-p.patch", mimetype="Text/Plain"):
Match (rule="2"):
Enforced policy: accept
Anomy 0.0.0 : Sanitizer.pm
$Id: Sanitizer.pm,v 1.32 2001/10/11 19:27:15 bre Exp $