(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.c) |
| |
| 2528 | | | proto_tree_set_uint(field_info *fi, guint32 value) |
| 2529 | | | { |
| 2530 | | | *hfinfo; |
| 2531 | | | guint32 integer; |
| 2532 | | | |
| 2533 | | | hfinfo = fi->hfinfo; |
| 2534 | | | integer = value; |
| 2535 | | | |
| 2536 | | | if (hfinfo->bitmask) { |
| 2537 | | | |
| 2538 | | | integer &= hfinfo->bitmask; |
| 2539 | | | |
| 2540 | | | |
| 2541 | | | if (hfinfo->bitshift > 0) { |
| 2542 | | | integer >>= hfinfo->bitshift; |
| 2543 | | | } |
| 2544 | | | } |
| 2545 | | | |
| 2546 | | | if (hfinfo->type == FT_BOOLEAN) { |
| 2547 | | | const true_false_string *tfstring = &tfs_true_false; |
| 2548 | | | if (hfinfo->strings) { |
| 2549 | | | tfstring = (const struct true_false_string*) hfinfo->strings; |
| 2550 | | | } |
| 2551 | | | col_custom_set_fstr(fi->hfinfo, "%s", integer ? tfstring->true_string : tfstring->false_string); |
| 2552 | | | } else if (hfinfo->strings) { |
| 2553 | | | if (hfinfo->display & BASE_RANGE_STRING) { |
| 2554 | | | col_custom_set_fstr(fi->hfinfo, "%s", rval_to_str(integer, hfinfo->strings, "%u")); |
| 2555 | | | } else { |
| 2556 | | | col_custom_set_fstr(fi->hfinfo, "%s", val_to_str(integer, cVALS(hfinfo->strings), "%u")); |
| 2557 | | | } |
| 2558 | | | } else if (IS_BASE_DUAL(hfinfo->display)) {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
162 | #define IS_BASE_DUAL(b) ((b)==BASE_DEC_HEX||(b)==BASE_HEX_DEC) |
| |
|
| 2559 | | | col_custom_set_fstr(fi->hfinfo, hfinfo_uint_value_format(hfinfo), integer, integer); |
Format String
col_custom_set_fstr() is being called with a format string that is not constant. The format string (second argument) may not match the other arguments to col_custom_set_fstr(); this could lead to security or stability problems. col_custom_set_fstr() is usually called with strings that look like format strings in this project. |
|
| 2560 | | | } else { |
| 2561 | | | col_custom_set_fstr(fi->hfinfo, hfinfo_uint_value_format(hfinfo), integer); |
| 2562 | | | } |
| 2563 | | | fvalue_set_uinteger(&fi->value, integer); |
| 2564 | | | } |
| |