(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.c) |
| |
| 2695 | | | proto_tree_set_int(field_info *fi, gint32 value) |
| 2696 | | | { |
| 2697 | | | *hfinfo; |
| 2698 | | | guint32 integer; |
| 2699 | | | |
| 2700 | | | hfinfo = fi->hfinfo; |
| 2701 | | | integer = (guint32) value; |
| 2702 | | | |
| 2703 | | | if (hfinfo->bitmask) { |
| 2704 | | | |
| 2705 | | | integer &= hfinfo->bitmask; |
| 2706 | | | |
| 2707 | | | |
| 2708 | | | if (hfinfo->bitshift > 0) { |
| 2709 | | | integer >>= hfinfo->bitshift; |
| 2710 | | | } |
| 2711 | | | } |
| 2712 | | | |
| 2713 | | | if (hfinfo->strings) { |
| 2714 | | | if (hfinfo->display & BASE_RANGE_STRING) { |
| 2715 | | | col_custom_set_fstr(fi->hfinfo, "%s", rval_to_str(integer, hfinfo->strings, "%d")); |
| 2716 | | | } else { |
| 2717 | | | col_custom_set_fstr(fi->hfinfo, "%s", val_to_str(integer, cVALS(hfinfo->strings), "%d")); |
| 2718 | | | } |
| 2719 | | | } 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) |
| |
|
| 2720 | | | col_custom_set_fstr(fi->hfinfo, hfinfo_int_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. |
|
| 2721 | | | } else { |
| 2722 | | | col_custom_set_fstr(fi->hfinfo, hfinfo_int_value_format(hfinfo), integer); |
| 2723 | | | } |
| 2724 | | | fvalue_set_sinteger(&fi->value, integer); |
| 2725 | | | } |
| |