Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at packet-dmp.c:1229

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

register_dmp_id

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dmp.c)expand/collapse
Show more  
 1126  static void register_dmp_id (packet_info *pinfo, guint8 reason)
 1127  {
 1128    dmp_id_val *dmp_data = NULL, *pkg_data = NULL;
 1129    dmp_id_key *dmp_key = NULL;
 1130    nstime_t    msg_time = { 0, 0 };
 1131    guint       msg_id = 0;
 1132   
 1133    if (pinfo->in_error_pkt) {
 1134      /* No analysis of error packets */
 1135      return;
 1136    }
 1137     
 1138    dmp_key = se_alloc (sizeof (dmp_id_key));
 1139   
 1140    if (!pinfo->fd->flags.visited &&  
 1141        (dmp.msg_type == REPORT || dmp.msg_type == NOTIF))  
 1142    {
 1143      /* Try to match corresponding message */
 1144      dmp_key->id = (guint) dmp.subj_id;
 1145      SE_COPY_ADDRESS(&dmp_key->src, &(pinfo->dst));
 1146      SE_COPY_ADDRESS(&dmp_key->dst, &(pinfo->src));
 1147   
 1148      dmp_data = (dmp_id_val *) g_hash_table_lookup (dmp_id_hash_table, dmp_key);
 1149   
 1150      if (dmp_data) {
 1151        /* Found message */
 1152        if (dmp_data->prev_msg_id > 0) {
 1153          msg_id = dmp_data->prev_msg_id;
 1154        } else {
 1155          msg_id = dmp_data->msg_id;
 1156        }
 1157        msg_time = dmp_data->msg_time;
 1158      }
 1159    }
 1160   
 1161    if (dmp.msg_type == ACK) {
 1162      dmp_key->id = (guint) dmp.subj_id;
 1163      SE_COPY_ADDRESS(&dmp_key->src, &(pinfo->dst));
 1164      SE_COPY_ADDRESS(&dmp_key->dst, &(pinfo->src));
 1165    } else {
 1166      dmp_key->id = (guint) dmp.msg_id;
 1167      SE_COPY_ADDRESS(&dmp_key->src, &(pinfo->src));
 1168      SE_COPY_ADDRESS(&dmp_key->dst, &(pinfo->dst));
 1169    }
 1170   
 1171    dmp_data = (dmp_id_val *) g_hash_table_lookup (dmp_id_hash_table, dmp_key);
 1172   
 1173    if (!pinfo->fd->flags.visited) {
 1174      if (dmp_data) {
 1175        if (dmp.msg_type == ACK) {
 1176          /* Only save this data if positive ack */
 1177          if (reason == 0) {
 1178            if (dmp_data->ack_id == 0) {
 1179              /* Only save reference to first ACK */
 1180              dmp_data->ack_id = pinfo->fd->num;
 1181            } else {
 1182              /* Only count when resending */
 1183              dmp_data->ack_resend_count++;
 1184
1214
Show [ Lines 1184 to 1214 omitted. ]
 1215            dmp_data->msg_id = pinfo->fd->num;
 1216          }
 1217   
 1218          g_hash_table_insert (dmp_id_hash_table, dmp_key, dmp_data);
 1219        }
 1220      }
 1221   
 1222      pkg_data = se_alloc (sizeof (dmp_id_val));
 1223      *pkg_data = *dmp_data;
 1224      p_add_proto_data (pinfo->fd, proto_dmp, pkg_data);
 1225    } else {
 1226      /* Fetch last values from data saved in packet */
 1227[+]     pkg_data = p_get_proto_data (pinfo->fd, proto_dmp);
 1228   
 1229      if (dmp_data && dmp.msg_type != ACK && pkg_data->ack_id == 0) {
Show more  




Change Warning 2312.30604 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: