Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at emem.c:1507

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

emem_tree_insert_string

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/emem.c)expand/collapse
Show more  
 1472  emem_tree_insert_string(emem_tree_t* se_tree, const gchar* k, void* v, guint32 flags)
 1473  {
 1474          emem_tree_key_t key[2];
 1475          guint32 *aligned=NULL;
 1476          guint32 len = (guint32) strlen(k);
 1477          guint32 div = (len+3)/4+1;
 1478          guint32 i;
 1479          guint32 tmp;
 1480   
 1481          aligned = malloc(div * sizeof (guint32));
 1482   
 1483          /* pack the bytes one one by one into guint32s */
 1484          tmp = 0;
 1485          for (i = 0;i < len;i++) {
 1486                  unsigned char ch;
 1487   
 1488                  ch = (unsigned char)k[i];
 1489                  if (flags & EMEM_TREE_STRING_NOCASE) {
 1490                          if(isupper(ch)) {
 1491                                  ch = tolower(ch);
 1492                          }
 1493                  }
 1494                  tmp <<= 8;
 1495                  tmp |= ch;
 1496                  if (i%4 == 3) {
 1497                          aligned[i/4] = tmp;
 1498                          tmp = 0;
 1499                  }
 1500          }
 1501          /* add required padding to the last uint32 */
 1502          if (i%4 != 0) {
 1503                  while (i%4 != 0) {
 1504                          i++;
 1505                          tmp <<= 8;
 1506                  }
 1507                  aligned[i/4-1] = tmp;
Show more  




Change Warning 1190.30494 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: