diff options
author | Laurent Deniel <laurent.deniel@free.fr> | 2003-03-01 14:12:38 +0000 |
---|---|---|
committer | Laurent Deniel <laurent.deniel@free.fr> | 2003-03-01 14:12:38 +0000 |
commit | 06c3a3ab5efe54d32c8588ffbbc10b7b400b989b (patch) | |
tree | f3062b1c45ad0d195c778866042b8cfdaa755307 /packet-rsync.c | |
parent | 9c27b912d6bdce85966bbb0e9f7fa7d1ea9d5eca (diff) | |
download | wireshark-06c3a3ab5efe54d32c8588ffbbc10b7b400b989b.tar.gz wireshark-06c3a3ab5efe54d32c8588ffbbc10b7b400b989b.tar.bz2 wireshark-06c3a3ab5efe54d32c8588ffbbc10b7b400b989b.zip |
Fix possible null pointer deference (conversation_data).
svn path=/trunk/; revision=7244
Diffstat (limited to 'packet-rsync.c')
-rw-r--r-- | packet-rsync.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packet-rsync.c b/packet-rsync.c index c669ad0463..69bd4f07da 100644 --- a/packet-rsync.c +++ b/packet-rsync.c @@ -3,7 +3,7 @@ * [ very rough, but mininally functional ] * Copyright 2003, Brad Hards <bradh@frogmouth.net> * - * $Id: packet-rsync.c,v 1.2 2003/02/20 12:04:11 jmayer Exp $ + * $Id: packet-rsync.c,v 1.3 2003/03/01 14:12:38 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -112,6 +112,11 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, conversation = conversation_new(&pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0); + } + + conversation_data = conversation_get_proto_data(conversation, proto_rsync); + + if (conversation_data == NULL) { conversation_data = malloc(sizeof(struct rsync_conversation_data)); conversation_data->state = RSYNC_INIT; conversation_add_proto_data(conversation, proto_rsync, conversation_data); @@ -123,8 +128,6 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rsync_tree = proto_item_add_subtree(ti, ett_rsync); - conversation_data = conversation_get_proto_data(conversation, proto_rsync); - frame_data = p_get_proto_data(pinfo->fd, proto_rsync); if (!frame_data) { /* then we haven't seen this frame before */ |