Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Computation  at tvbuff.c:1046

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

tvb_memcpy

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/tvbuff.c)expand/collapse
Show more  
 1009  void*
 1010  tvb_memcpy(tvbuff_t *tvb, void* target, gint offset, size_t length)
 1011  {
 1012          guint   abs_offset, abs_length;
 1013   
 1014          /*
 1015           * XXX - we should eliminate the "length = -1 means 'to the end
 1016           * of the tvbuff'" convention, and use other means to achieve
 1017           * that; this would let us eliminate a bunch of checks for
 1018           * negative lengths in cases where the protocol has a 32-bit
 1019           * length field.
 1020           *
 1021           * Allowing -1 but throwing an assertion on other negative 
 1022           * lengths is a bit more work with the length being a size_t;
 1023           * instead, we check for a length <= 2^31-1.
 1024           */
 1025          DISSECTOR_ASSERT(length <= 0x7FFFFFFF);
 1026          check_offset_length(tvb, offset, (gint) length, &abs_offset, &abs_length);
 1027   
 1028          if (tvb->real_data) {
 1029                  return memcpy(target, tvb->real_data + abs_offset, abs_length);
 1030          }
 1031   
 1032          switch(tvb->type) {
 1033                  case TVBUFF_REAL_DATA:
 1034                          DISSECTOR_ASSERT_NOT_REACHED();
 1035   
 1036                  case TVBUFF_SUBSET:
 1037                          return tvb_memcpy(tvb->tvbuffs.subset.tvb, target,
 1038                                          abs_offset - tvb->tvbuffs.subset.offset,
 1039                                          abs_length);
 1040   
 1041                  case TVBUFF_COMPOSITE:
 1042                          return composite_memcpy(tvb, target, offset, length);
 1043          }
 1044   
 1045          DISSECTOR_ASSERT_NOT_REACHED();
 1046          return NULL;
 1047  }
Show more  




Change Warning 1123.30746 : Unreachable Computation

Priority:
State:
Finding:
Owner:
Note: