aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ldss.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-10 15:31:29 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-10 15:31:29 +0000
commit939e04e74bbde76e2fe917fd6cd44b44756d5cc4 (patch)
tree5079f7d7b24d05110831f5c66c3c35fd8c9318f8 /epan/dissectors/packet-ldss.c
parent7eb15db51c2bf0879b5266495223752a959a3de2 (diff)
In dissect_ldss_transfer(), reject the packet if data is NULL. Fix some typos.
svn path=/trunk/; revision=53905
Diffstat (limited to 'epan/dissectors/packet-ldss.c')
-rw-r--r--epan/dissectors/packet-ldss.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/epan/dissectors/packet-ldss.c b/epan/dissectors/packet-ldss.c
index ab412f6f90..3c22614966 100644
--- a/epan/dissectors/packet-ldss.c
+++ b/epan/dissectors/packet-ldss.c
@@ -24,7 +24,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-/* LDSS is a protocol for peers on a LAN to co-operatively download
+/* LDSS is a protocol for peers on a LAN to cooperatively download
* files from a WAN. The peers ask each other about files and can
* send files to each other, thus WAN use is minimized. However
* if no peer possesses a file, a peer can download it via the WAN.
@@ -445,7 +445,7 @@ dissect_ldss_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Transfers happen in response to broadcasts, they are always TCP and are
* used to send the file to the port mentioned in the broadcast. There are
* 2 types of transfers: Pushes, which are direct responses to searches,
- * in which the peer that has the file connects to the peer that doesnt and
+ * in which the peer that has the file connects to the peer that doesn't and
* sends it, then disconnects. The other type of transfer is a pull, where
* the peer that doesn't have the file connects to the peer that does and
* requests it be sent.
@@ -459,16 +459,19 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
{
conversation_t *transfer_conv;
ldss_transfer_info_t *transfer_info;
- struct tcpinfo *transfer_tcpinfo = (struct tcpinfo *)data;
-
+ struct tcpinfo *transfer_tcpinfo;
proto_tree *ti, *line_tree = NULL, *ldss_tree = NULL;
-
nstime_t broadcast_response_time;
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ transfer_tcpinfo = (struct tcpinfo *)data;
+
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LDSS");
/* Look for the transfer conversation; this was created during
- * earlier broadcast dissection (see prepate_ldss_transfer_conv) */
+ * earlier broadcast dissection (see prepare_ldss_transfer_conv) */
transfer_conv = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst,
PT_TCP, pinfo->srcport, pinfo->destport, 0);
transfer_info = (ldss_transfer_info_t *)conversation_get_proto_data(transfer_conv, proto_ldss);
@@ -999,7 +1002,7 @@ proto_reg_handoff_ldss (void)
if (!ldss_initialized) {
ldss_udp_handle = new_create_dissector_handle(dissect_ldss, proto_ldss);
- ldss_tcp_handle = new_create_dissector_handle(dissect_ldss_transfer, proto_ldss);
+ ldss_tcp_handle = new_create_dissector_handle(dissect_ldss_transfer, proto_ldss);
ldss_initialized = TRUE;
}
else {