Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Computation  at tvbparse.c:800

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

cond_until

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/tvbparse.c)expand/collapse
Show more  
 754  static int cond_until(tvbparse_t* tt, int offset, const tvbparse_wanted_t * wanted, tvbparse_elem_t** tok) {
 755      tvbparse_elem_t* new = NULL;
 756      int len = 0;
 757      int target_offset = offset;
 758  #ifdef TVBPARSE_DEBUG 
 759      if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: START");
 760  #endif
 761       
 762      if ( offset + wanted->control.until.subelem->len > tt->end_offset )
 763          return -1;
 764       
 765      do {
 766          len = wanted->control.until.subelem->condition(tt, target_offset++, wanted->control.until.subelem,  &new);
 767      } while(len < 0  && target_offset+1 < tt->end_offset);
 768       
 769      if (len >= 0) {
 770           
 771          new->id = wanted->id;
 772          new->next = NULL;
 773          new->last = NULL;
 774          new->wanted = wanted;
 775          new->offset = offset;
 776           
 777          (*tok) = new;        
 778           
 779          switch (wanted->control.until.mode) {
 780              case TP_UNTIL_INCLUDE:
 781                  new->len = target_offset - offset - 1 + len;
 782  #ifdef TVBPARSE_DEBUG 
 783                  if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: GOT len=%i",target_offset - offset -1 + len);
 784  #endif
 785                  return target_offset - offset -1 + len;
 786              case TP_UNTIL_SPEND:
 787                  new->len = target_offset - offset - 1;
 788  #ifdef TVBPARSE_DEBUG 
 789                  if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: GOT len=%i",target_offset - offset -1 + len);
 790  #endif
 791                  return target_offset - offset - 1 + len;
 792              case TP_UNTIL_LEAVE:
 793                  new->len = target_offset - offset - 1;
 794  #ifdef TVBPARSE_DEBUG 
 795                  if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_UNTIL) g_warning("cond_until: GOT len=%i",target_offset - offset -1);
 796  #endif                
 797                  return target_offset - offset -1;
 798              default:
 799                  DISSECTOR_ASSERT_NOT_REACHED();
 800                  return -1;
 801          }
 802           
 803      } else {
 804          return -1;
 805      }
 806  }
Show more  




Change Warning 3510.30430 : Unreachable Computation

Priority:
State:
Finding:
Owner:
Note: