aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Deniel <laurent.deniel@free.fr>2003-03-01 14:12:38 +0000
committerLaurent Deniel <laurent.deniel@free.fr>2003-03-01 14:12:38 +0000
commit06c3a3ab5efe54d32c8588ffbbc10b7b400b989b (patch)
treef3062b1c45ad0d195c778866042b8cfdaa755307
parent9c27b912d6bdce85966bbb0e9f7fa7d1ea9d5eca (diff)
Fix possible null pointer deference (conversation_data).
svn path=/trunk/; revision=7244
-rw-r--r--packet-rsync.c9
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 */