(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/gryphon/packet-gryphon.c) |
| |
| 2201 | | | blm_mode(tvbuff_t *tvb, int offset, proto_tree *pt) |
| 2202 | | | { |
| 2203 | | | const char *mode; |
| 2204 | | | char line[50]; |
| 2205 | | | int x, y, seconds; |
| 2206 | | | |
| 2207 | | | x = tvb_get_ntohl(tvb, offset); |
| 2208 | | | y = tvb_get_ntohl(tvb, offset+4); |
| 2209 | | | switch (x) { |
| 2210 | | | case 0: |
| 2211 | | | mode = "Off"; |
| 2212 | | | g_snprintf (line, 50, "reserved"); |
| 2213 | | | break; |
| 2214 | | | case 1: |
| 2215 | | | mode = "Average over time"; |
| 2216 | | | seconds = y / 1000; |
| 2217 | | | y = y % 1000; |
| 2218 | | | g_snprintf (line, 50, "Averaging period: %d.%03d seconds", seconds, y); |
| 2219 | | | break; |
| 2220 | | | case 2: |
| 2221 | | | mode = "Average over frame count"; |
| 2222 | | | g_snprintf (line, 50, "Averaging period: %d frames", y); |
| 2223 | | | break; |
| 2224 | | | default: |
| 2225 | | | mode = "- unknown -"; |
| 2226 | | | g_snprintf (line, 50, "reserved"); |
| 2227 | | | } |
| 2228 | | | proto_tree_add_text(pt, tvb, offset, 4, "Mode: %s", mode); |
| 2229 | | | offset += 4; |
| 2230 | | | proto_tree_add_text(pt, tvb, offset, 4, line, NULL); |
Format String
proto_tree_add_text() is being called with a format string that is not constant. The format string (fifth argument) may not match the other arguments to proto_tree_add_text(); this could lead to security or stability problems. proto_tree_add_text() is usually called with strings that look like format strings in this project. |
|
| 2231 | | | offset += 4; |
| 2232 | | | return offset; |
| 2233 | | | } |
| |