Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at packet-ssl-utils.c:2808

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

decrypt_dtls_record

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dtls.c)expand/collapse
Show more  
 477  decrypt_dtls_record(tvbuff_t *tvb, packet_info *pinfo, guint32 offset,
 478                      guint32 record_length, guint8 content_type, SslDecryptSession* ssl,
 479                      gboolean save_plaintext)
 480  {
 481    gint ret;
 482    gint direction;
 483    SslDecoder* decoder;
 484    ret = 0;
 485   
 486    /* if we can decrypt and decryption have success
 487     * add decrypted data to this packet info */
 488    ssl_debug_printf("decrypt_dtls_record: app_data len %d ssl state %X\n",
 489                     record_length, ssl->state);
 490    if (!(ssl->state & SSL_HAVE_SESSION_KEY)) {
 491      ssl_debug_printf("decrypt_dtls_record: no session key\n");
 492      return ret;
 493    }
 494   
 495    /* retrive decoder for this packet direction */
 496    if ((direction = ssl_packet_from_server(dtls_associations, pinfo->srcport, pinfo->ptype == PT_TCP)) != 0) {
 497      ssl_debug_printf("decrypt_dtls_record: using server decoder\n");
 498      decoder = ssl->server;
 499    }
 500    else {
 501      ssl_debug_printf("decrypt_dtls_record: using client decoder\n");
 502      decoder = ssl->client;
 503    }
 504   
 505    /* ensure we have enough storage space for decrypted data */
 506    if (record_length > dtls_decrypted_data.data_len)
 507      {
 508        ssl_debug_printf("decrypt_dtls_record: allocating %d bytes"
 509                         " for decrypt data (old len %d)\n",
 510                         record_length + 32, dtls_decrypted_data.data_len);
 511        dtls_decrypted_data.data = g_realloc(dtls_decrypted_data.data,
 512                                             record_length + 32);
 513        dtls_decrypted_data.data_len = record_length + 32;
 514      }
 515   
 516    /* run decryption and add decrypted payload to protocol data, if decryption
 517     * is successful*/
 518    dtls_decrypted_data_avail = dtls_decrypted_data.data_len;
 519    if (ssl_decrypt_record(ssl, decoder,
 520                           content_type, tvb_get_ptr(tvb, offset, record_length),
 521                           record_length, &dtls_compressed_data, &dtls_decrypted_data, &dtls_decrypted_data_avail) == 0)
 522      ret = 1;
 523   
 524      if (ret && save_plaintext) {
 525[+]       ssl_add_data_info(proto_dtls, pinfo, dtls_decrypted_data.data, dtls_decrypted_data_avail,  TVB_RAW_OFFSET(tvb)+offset, 0);
expand/collapse

ssl_add_data_info

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ssl-utils.c)expand/collapse
Show more  
 2791  ssl_add_data_info(gint proto, packet_info *pinfo, guchar* data, gint data_len, gint key, SslFlow *flow)
 2792  {
 2793    SslDataInfo *rec, **prec;
 2794    SslPacketInfo *pi;
 2795   
 2796    pi = p_get_proto_data(pinfo->fd, proto);
 2797    if (!pi)
 2798      {
 2799        pi = se_alloc0(sizeof(SslPacketInfo));
 2800        p_add_proto_data(pinfo->fd, proto,pi);
 2801      }
 2802   
 2803    rec = se_alloc(sizeof(SslDataInfo)+data_len);
 2804    rec->key = key;
 2805    rec->plain_data.data = (guchar*)(rec + 1);
 2806    memcpy(rec->plain_data.data, data, data_len);
 2807    rec->plain_data.data_len = data_len;
 2808    rec->seq = flow->byte_seq;
Show more  
Show more  




Change Warning 2334.31078 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: