if the packet is mangled the oid string might be NULL.
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 20 Nov 2005 02:48:26 +0000 (02:48 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 20 Nov 2005 02:48:26 +0000 (02:48 +0000)
dont try to register a NULL oid

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16553 f5534014-38df-0310-8fa8-9805f1628bb7

asn1/pres/packet-pres-template.c
asn1/pres/pres.cnf
epan/dissectors/packet-pres.c
epan/dissectors/packet-pres.h

index 7e7513b6ffd45e1a1968fc5e65cdedcba1e189f3..740c7749081666373c68928830c572e26c0812ad 100644 (file)
@@ -116,6 +116,12 @@ register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid)
        pres_ctx_oid_t *pco, *tmppco;
        pco=se_alloc(sizeof(pres_ctx_oid_t));
        pco->ctx_id=idx;
+
+       if(!oid){
+               /* we did not get any oid name, malformed packet? */
+               return;
+       }
+
        pco->oid=se_strdup(oid);
 
        /* if this ctx already exists, remove the old one first */
index ba2d332ac9e02ee66731d37c60e7508ef4ffd879..dcae453ddb065f5cf99050f3a7faf929f2f3bd06 100644 (file)
@@ -75,6 +75,9 @@ CPR-PPDU/normal-mode-parameters/provider-reason cPR_PPDU__provider-reason
   if(session)
        session->pres_ctx_id = presentation_context_identifier;
 
+#.FN_HDR Context-list/_item
+       abstract_syntax_name_oid=NULL;
+#.END
 #.FN_FTR Context-list/_item
        register_ctx_id_and_oid(pinfo, presentation_context_identifier, abstract_syntax_name_oid);
 #.END
index ba0b1c49a6a8b67e292731ba08cd0964c42d924c..834e4c7ff294385a8d1c1707be589faf78d74aa9 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* .\packet-pres.c                                                            */
+/* ./packet-pres.c                                                            */
 /* ../../tools/asn2eth.py -X -b -e -p pres -c pres.cnf -s packet-pres-template ISO8823-PRESENTATION.asn */
 
 /* Input file: packet-pres-template.c */
@@ -245,6 +245,12 @@ register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid)
        pres_ctx_oid_t *pco, *tmppco;
        pco=se_alloc(sizeof(pres_ctx_oid_t));
        pco->ctx_id=idx;
+
+       if(!oid){
+               /* we did not get any oid name, malformed packet? */
+               return;
+       }
+
        pco->oid=se_strdup(oid);
 
        /* if this ctx already exists, remove the old one first */
@@ -461,6 +467,7 @@ static const ber_sequence_t Context_list_item_sequence[] = {
 
 static int
 dissect_pres_Context_list_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
+       abstract_syntax_name_oid=NULL;
   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
                                    Context_list_item_sequence, hf_index, ett_pres_Context_list_item);
 
index 8fa80518873adb9d16e3aa4bb488e357fca17a65..24c32e1e12b2ee432e9d9332d24f50c9ec30ea19 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* .\packet-pres.h                                                            */
+/* ./packet-pres.h                                                            */
 /* ../../tools/asn2eth.py -X -b -e -p pres -c pres.cnf -s packet-pres-template ISO8823-PRESENTATION.asn */
 
 /* Input file: packet-pres-template.h */