(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-icep.c) |
| |
| 282 | | | static void dissect_ice_facet(proto_tree *tree, int hf_icep, |
| 283 | | | tvbuff_t *tvb, guint32 offset, gint32 *consumed) |
| 284 | | | { |
| 285 | | | |
| 286 | | | |
| 287 | | | |
| 288 | | | |
| 289 | | | |
| 290 | | | |
| 291 | | | |
| 292 | | | |
| 293 | | | |
| 294 | | | |
| 295 | | | |
| 296 | | | |
| 297 | | | |
| 298 | | | |
| 299 | | | |
| 300 | | | |
| 301 | | | |
| 302 | | | guint32 Size = 0; |
| 303 | | | char *s = NULL; |
| 304 | | | |
| 305 | | | (*consumed) = 0; |
| 306 | | | |
| 307 | | | |
| 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 | | | |
| 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 | | | |
| 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; |
Unused Value
The value assigned to offset is never subsequently used on any execution path. |
|
| 349 | | | (*consumed) += consumed_facet; |
| 350 | | | return; |
| 351 | | | } |
| 352 | | | |
| 353 | | | |
| 354 | | | |
| 355 | | | if (tree) |
| 356 | | | |
| 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 | | | } |
| |