Removed trailing whitespaces from .h and .c files using the
[obnox/wireshark/wip.git] / packet-dcerpc-mapi.c
index 362c921b0aa2d5bc80209023cc6a4f5ee575502a..67b59cbb9bc1f748821162fb6318c3a95a5082fe 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for MS Exchange MAPI
  * Copyright 2002, Ronnie Sahlberg
  *
- * $Id: packet-dcerpc-mapi.c,v 1.10 2002/06/04 07:03:44 guy Exp $
+ * $Id: packet-dcerpc-mapi.c,v 1.12 2002/06/24 00:03:17 tpot Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -157,6 +157,10 @@ mapi_decrypt_pdu(tvbuff_t *tvb, int offset,
        offset=dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_mapi_decrypted_data_offset, NULL);
        offset=dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_mapi_decrypted_data_len, &len);
 
+       if(len>(guint32)tvb_length_remaining(tvb, offset)){
+               len=tvb_length_remaining(tvb, offset);
+       }
+
        if(!pinfo->fd->flags.visited){
                mmd=g_mem_chunk_alloc(mapi_decrypted_data_chunk);
                mmd->callid=di->call_id;
@@ -179,7 +183,6 @@ mapi_decrypt_pdu(tvbuff_t *tvb, int offset,
 
        add_new_data_source(pinfo, mmd->tvb, "Decrypted MAPI");
 
-
        /* decrypted PDU */
        /* All from 10 minutes eyeballing. This may be wrong.
           The PDU is NOT NDR encoded. So this completely new marshalling
@@ -449,5 +452,5 @@ proto_reg_handoff_dcerpc_mapi(void)
 
         dcerpc_init_uuid(proto_dcerpc_mapi, ett_dcerpc_mapi, 
                          &uuid_dcerpc_mapi, ver_dcerpc_mapi, 
-                         dcerpc_mapi_dissectors);
+                         dcerpc_mapi_dissectors, -1);
 }