(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/gryphon/packet-gryphon.c) |
| |
| 1423 | | | resp_blm_data(tvbuff_t *tvb, int offset, proto_tree *pt) |
| 1424 | | | { |
| 1425 | | | unsigned int i; |
| 1426 | | | int hours, minutes, seconds, fraction, x, fract; |
| 1427 | | | unsigned long timestamp; |
| 1428 | | | static const char *fields[] = { |
| 1429 | | | "Bus load average: %d.%02d%%", |
| 1430 | | | "Current bus load: %d.%02d%%", |
| 1431 | | | "Peak bus load: %d.%02d%%", |
| 1432 | | | "Historic peak bus load: %d.%02d%%" |
| 1433 | | | }; |
| 1434 | | | |
| 1435 | | | timestamp = tvb_get_ntohl(tvb, offset); |
| 1436 | | | hours = timestamp /(100000 * 60 *60); |
| 1437 | | | minutes = (timestamp / (100000 * 60)) % 60; |
| 1438 | | | seconds = (timestamp / 100000) % 60; |
| 1439 | | | fraction = timestamp % 100000; |
| 1440 | | | proto_tree_add_text(pt, tvb, offset, 4, "Timestamp: %d:%02d:%02d.%05d", hours, minutes, seconds, fraction); |
| 1441 | | | offset += 4; |
| 1442 | | | for (i = 0; i < SIZEOF(fields); i++){ |
| 1443 | | | x = tvb_get_ntohs(tvb, offset); |
| 1444 | | | fract = x % 100; |
| 1445 | | | x /= 100; |
| 1446 | | | proto_tree_add_text(pt, tvb, offset, 2, fields[i], x, fract); |
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. |
|
| 1447 | | | offset += 2; |
| 1448 | | | } |
| 1449 | | | return offset; |
| 1450 | | | } |
| |