diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-01-26 05:04:29 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-01-26 05:04:29 +0000 |
commit | 4afbcb86b1822f45b3bccd5722d149283526b3bf (patch) | |
tree | 5908bdbe759a59259ec06ec2c5c07facf70f1b76 /packet-osi.c | |
parent | e7e11b390d132139b2ec4f65e31bfe055f72dcc3 (diff) |
In "dissect_clnp()", fill in "clnp" before looking at it.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1567 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-osi.c')
-rw-r--r-- | packet-osi.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packet-osi.c b/packet-osi.c index 1026af5dc2..e513c15d80 100644 --- a/packet-osi.c +++ b/packet-osi.c @@ -1,7 +1,7 @@ /* packet-osi.c * Routines for ISO/OSI network and transport protocol packet disassembly * - * $Id: packet-osi.c,v 1.18 2000/01/24 03:33:31 guy Exp $ + * $Id: packet-osi.c,v 1.19 2000/01/26 05:04:29 guy Exp $ * Laurent Deniel <deniel@worldnet.fr> * * Ethereal - Network traffic analyzer @@ -1450,7 +1450,10 @@ void dissect_clnp(const u_char *pd, int offset, frame_data *fd, u_char src_len, dst_len, nsel; u_int first_offset = offset; - if (pd[offset]==NLPID_NULL) { + /* avoid alignment problem */ + memcpy(&clnp, &pd[offset], sizeof(clnp)); + + if (clnp.cnf_proto_id == NLPID_NULL) { if (tree) { ti = proto_tree_add_item(tree, proto_clnp, offset, 1, NULL); clnp_tree = proto_item_add_subtree(ti, ett_clnp); @@ -1467,9 +1470,6 @@ void dissect_clnp(const u_char *pd, int offset, frame_data *fd, return; } - /* avoid alignment problem */ - memcpy(&clnp, &pd[offset], sizeof(clnp)); - /* return if version not known */ if (clnp.cnf_vers != ISO8473_V1) { dissect_data(pd, offset, fd, tree); |