Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Call  at tvbuff.c:438

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

check_offset_length_no_exception

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/tvbuff.c)expand/collapse
Show more  
 391  check_offset_length_no_exception(tvbuff_t *tvb, gint offset, gint length,
 392                  guint *offset_ptr, guint *length_ptr, int *exception)
 393  {
 394          guint   end_offset;
 395   
 396          DISSECTOR_ASSERT(tvb && tvb->initialized);
 397   
 398          if (!compute_offset_length(tvb, offset, length, offset_ptr, length_ptr, exception)) {
 399                  return FALSE;
 400          }
 401   
 402          /*
 403           * Compute the offset of the first byte past the length.
 404           */
 405          end_offset = *offset_ptr + *length_ptr;
 406   
 407          /*
 408           * Check for an overflow, and clamp "end_offset" at the maximum 
 409           * if we got an overflow - that should force us to indicate that 
 410           * we're past the end of the tvbuff.
 411           */
 412          if (end_offset < *offset_ptr)
 413                  end_offset = UINT_MAX;
 414   
 415          /*
 416           * Check whether that offset goes more than one byte past the 
 417           * end of the buffer.
 418           *
 419           * If not, return TRUE; otherwise, return FALSE and, if "exception"
 420           * is non-null, return the appropriate exception through it.
 421           */
 422          if (end_offset <= tvb->length) {
 423                  return TRUE;
 424          }
 425          else if (end_offset <= tvb->reported_length) {
 426                  if (exception) {
 427                          *exception = BoundsError;
 428                  }
 429                  return FALSE;
 430          }
 431          else {
 432                  if (exception) {
 433                          *exception = ReportedBoundsError;
 434                  }
 435                  return FALSE;
 436          }
 437   
 438          DISSECTOR_ASSERT_NOT_REACHED();
 439  }
Show more  




Change Warning 1121.30440 : Unreachable Call

Priority:
State:
Finding:
Owner:
Note: