Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at packet-pres.c:1369

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

dissect_pres

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-pres.c)expand/collapse
Show more  
 1404  dissect_pres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
 1405  {
 1406          int offset = 0, old_offset;
 1407   
 1408          /* first, try to check length   */
 1409          /* do we have at least 4 bytes  */
 1410[+]         if (!tvb_bytes_exist(tvb, 0, 4)){
 1411                  session = ((struct SESSION_DATA_STRUCTURE*)(pinfo->private_data));
 1412                  if (session && session->spdu_type != SES_MAJOR_SYNC_POINT) {
 1413                          proto_tree_add_text(parent_tree, tvb, offset,  
 1414                                              tvb_reported_length_remaining(tvb,offset),"User data");
 1415                          return;  /* no, it isn't a presentation PDU */
 1416                  }
 1417          }
 1418   
 1419          /*  we can't make any additional checking here   */
 1420          /*  postpone it before dissector will have more information */
 1421   
 1422[+]         if (check_col(pinfo->cinfo, COL_PROTOCOL))
 1423                  col_set_str(pinfo->cinfo, COL_PROTOCOL, "PRES");
 1424[+]         if (check_col(pinfo->cinfo, COL_INFO))
 1425                  col_clear(pinfo->cinfo, COL_INFO);
 1426          /* save pointers for calling the acse dissector  */
 1427          global_tree = parent_tree;
 1428          global_pinfo = pinfo;
 1429   
 1430          if (session && session->spdu_type == SES_MAJOR_SYNC_POINT) {
 1431                  /* This is a reassembly initiated in packet-ses */
 1432                  char *oid = find_oid_by_pres_ctx_id (pinfo, session->pres_ctx_id);
 1433                  if (oid) {
 1434                          call_ber_oid_callback (oid, tvb, offset, pinfo, parent_tree);
 1435                  } else {
 1436                          proto_tree_add_text(parent_tree, tvb, offset,  
 1437                                              tvb_reported_length_remaining(tvb,offset),"User data");
 1438                  }
 1439                  return;
 1440           }
 1441               
 1442[+]         while (tvb_reported_length_remaining(tvb, offset) > 0){
 1443                  old_offset = offset;
 1444[+]                 offset = dissect_ppdu(tvb, offset, pinfo, parent_tree);
expand/collapse

dissect_ppdu

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-pres.c)expand/collapse
Show more  
 1333  dissect_ppdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
 1334  {
 1335          proto_item *ti;
 1336          proto_tree *pres_tree = NULL;
 1337          guint s_type;
 1338          asn1_ctx_t asn1_ctx;
 1339          asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
 1340   
 1341          /* do we have spdu type from the session dissector?  */
 1342          if( !pinfo->private_data ){
 1343                  if(tree){
 1344                          proto_tree_add_text(tree, tvb, offset, -1,
 1345                                  "Internal error:can't get spdu type from session dissector.");
 1346                          return  FALSE;
 1347                  }
 1348          }else{
 1349                  session  = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) );
 1350                  if(session->spdu_type == 0 ){
 1351                          if(tree){
 1352                                  proto_tree_add_text(tree, tvb, offset, -1,
 1353                                          "Internal error:wrong spdu type %x from session dissector.",session->spdu_type);
 1354                                  return  FALSE;
 1355                          }
 1356                  }
 1357          }
 1358          /* get type of tag */
 1359          s_type = tvb_get_guint8(tvb, offset);
 1360          /*  set up type of Ppdu */
 1361[+]         if (check_col(pinfo->cinfo, COL_INFO))
 1362                  col_add_str(pinfo->cinfo, COL_INFO,
 1363                              val_to_str(session->spdu_type, ses_vals, "Unknown Ppdu type (0x%02x)"));
 1364          if (tree){
 1365                  ti = proto_tree_add_item(tree, proto_pres, tvb, offset, -1, FALSE);
 1366                  pres_tree = proto_item_add_subtree(ti, ett_pres);
 1367          }
 1368   
 1369          switch(session->spdu_type){
Show more  
Show more  




Change Warning 1393.35211 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: