(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-v120.c) |
| |
| 182 | | | (tvbuff_t *tvb, int offset, proto_tree *tree) |
| 183 | | | { |
| 184 | | | char *info; |
| 185 | | | int , nbits; |
| 186 | | | int ; |
| 187 | | | proto_tree *h_tree, *tc; |
| 188 | | | guint8 byte0; |
| 189 | | | |
| 190 | | | info=ep_alloc(80); |
| 191 | | | byte0 = tvb_get_guint8(tvb, offset); |
| 192 | | | |
| 193 | | | if (byte0 & 0x80) { |
| 194 | | | = 1; |
| 195 | | | = byte0; |
| 196 | | | } else { |
| 197 | | | = 2; |
| 198 | | | = byte0 | tvb_get_guint8(tvb, offset + 1) << 8; |
| 199 | | | } |
| 200 | | | nbits = * 8; |
| 201 | | | g_snprintf(info, 80, ": B: %d F: %d", byte0 & 0x02 ? 1:0, |
| 202 | | | byte0 & 0x01 ? 1:0); |
| 203 | | | tc = proto_tree_add_text(tree, tvb, |
| 204 | | | offset, , |
| 205 | | | " octet: %s (0x%02X)", info, byte0); |
| 206 | | | h_tree = proto_item_add_subtree(tc, ); |
| 207 | | | proto_tree_add_text(h_tree, tvb, offset, , "%s", |
| 208 | | | decode_boolean_bitfield(, 0x80, nbits, |
| 209 | | | "No extension octet", "Extension octet follows")); |
| 210 | | | proto_tree_add_text(h_tree, tvb, offset, , "%s", |
| 211 | | | decode_boolean_bitfield(, 0x40, nbits, |
| 212 | | | "Break condition", "No break condition")); |
| 213 | | | g_snprintf(info, 80, "Error control C1/C2: %d", ( & 0x0c) >> 2); |
| 214 | | | proto_tree_add_text(h_tree, tvb, offset, , "%s", |
| 215 | | | decode_numeric_bitfield(, 0x0c, nbits, info)); |
| 216 | | | proto_tree_add_text(h_tree, tvb, offset, , "%s", |
| 217 | | | decode_boolean_bitfield(, 0x02, nbits, |
| 218 | | | "Segmentation bit B", "No segmentation bit B")); |
| 219 | | | proto_tree_add_text(h_tree, tvb, offset, , "%s", |
| 220 | | | decode_boolean_bitfield(, 0x01, nbits, |
| 221 | | | "Segmentation bit F", "No segmentation bit F")); |
| 222 | | | if ( == 2) { |
| 223 | | | proto_tree_add_text(h_tree, tvb, offset, , |
| 224 | | | decode_boolean_bitfield(, 0x8000, nbits, |
| 225 | | | "E", "E bit not set (Error)"), NULL); |
| 226 | | | proto_tree_add_text(h_tree, tvb, offset, , |
| 227 | | | decode_boolean_bitfield(, 0x4000, nbits, |
| 228 | | | "DR", "No DR"), 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. |
|
| 229 | | | proto_tree_add_text(h_tree, tvb, offset, , |
| 230 | | | decode_boolean_bitfield(, 0x2000, nbits, |
| 231 | | | "SR", "No SR"), NULL); |
| 232 | | | proto_tree_add_text(h_tree, tvb, offset, , |
| 233 | | | decode_boolean_bitfield(, 0x1000, nbits, |
| 234 | | | "RR", "No RR"), NULL); |
| 235 | | | } |
| 236 | | | return ; |
| 237 | | | } |
| |