Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at packet-icep.c:348

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

dissect_ice_facet

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-icep.c)expand/collapse
Show more  
 282  static void dissect_ice_facet(proto_tree *tree, int hf_icep,  
 283                                tvbuff_t *tvb, guint32 offset, gint32 *consumed)
 284  {
 285          /*  p. 588, chapter 23.2.6:
 286           *  "facet" is a StringSeq, a StringSeq is a:                
 287           *  sequence<string>
 288           *
 289           *
 290           * sequence == Size + SizeElements 
 291           * sequence = 1byte (0..254) + SizeElements 
 292           * or                                                       
 293           * sequence = 1byte (255) + 1int (255..2^32-1) + SizeElements 
 294           *
 295           *
 296           * p.613. chapter 23.3.2
 297           * "facet has either zero elements (empty) or one element"
 298           *
 299           *        
 300           */
 301           
 302          guint32 Size = 0; /* number of elements in the sequence */
 303          char *s = NULL;
 304           
 305          (*consumed) = 0;
 306           
 307          /* check first byte */
 308          if ( !tvb_bytes_exist(tvb, offset, 1) ) {
 309                   
 310                  if (tree)
 311                          proto_tree_add_text(tree, tvb, offset, -1, "facet field missing");
 312                   
 313                  if ( check_col(mypinfo->cinfo, COL_INFO) ) {
 314                          col_append_str(mypinfo->cinfo, COL_INFO,  
 315                                         " (facet field missing)");
 316                  }
 317                   
 318                  (*consumed) = -1;
 319                  return;
 320          }
 321           
 322          /* get first byte of Size */
 323          Size = tvb_get_guint8(tvb, offset);
 324          offset++;
 325          (*consumed)++;
 326           
 327          if ( Size == 0 ) {
 328                   
 329                  if (tree) {
 330                          s = ep_strdup( "(empty)" );
 331                          /* display the 0x00 Size byte when click on a empty ice_string */
 332                          proto_tree_add_string(tree, hf_icep, tvb, offset - 1, 1, s);
 333                  }
 334                  return;
 335          }
 336           
 337          if ( Size == 1 ) {
 338                   
 339                  gint32 consumed_facet = 0;
 340                   
 341                  dissect_ice_string(tree, hf_icep, tvb, offset, &consumed_facet, NULL, TRUE);
 342                   
 343                  if ( consumed_facet == -1 ) {
 344                          (*consumed) = -1;
 345                          return;
 346                  }
 347                   
 348                  offset += consumed_facet;
 349                  (*consumed) += consumed_facet;
 350                  return;
 351          }
 352           
 353          /* if here => Size > 1 => not possible */
 354           
 355          if (tree)
 356                  /* display the XX Size byte when click here */
 357                  proto_tree_add_text(tree, tvb, offset - 1, 1,  
 358                                      "facet can be max one element");
 359           
 360          if ( check_col(mypinfo->cinfo, COL_INFO) ) {
 361                  col_append_str(mypinfo->cinfo, COL_INFO,  
 362                                 " (facet can be max one element)");
 363          }
 364           
 365          (*consumed) = -1;
 366          return;
 367  }
Show more  




Change Warning 2659.31477 : Unused Value

Priority:
State:
Finding:
Owner:
Note: