(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ssl.c) |
| |
| 308 | | | ssl_parse(void) |
| 309 | | | { |
| 310 | | | ep_stack_t tmp_stack; |
| 311 | | | SslAssociation *tmp_assoc; |
| 312 | | | FILE *ssl_keys_file; |
| 313 | | | struct stat statb; |
| 314 | | | size_t size; |
| 315 | | | gchar *tmp_buf; |
| 316 | | | size_t nbytes; |
| 317 | | | gboolean read_failed; |
| 318 | | | |
| 319 | | | ssl_set_debug(ssl_debug_file_name); |
| 320 | | | |
| 321 | | | if (ssl_key_hash) |
Event 1:
Skipping " if". ssl_key_hash evaluates to false.
hide
|
|
| 322 | | | { |
| 323 | | | g_hash_table_foreach(ssl_key_hash, ssl_private_key_free, NULL); |
| 324 | | | g_hash_table_destroy(ssl_key_hash); |
| 325 | | | } |
| 326 | | | |
| 327 | | | |
| 328 | | | tmp_stack = ep_stack_new(); |
| 329 | | | g_tree_foreach(ssl_associations, ssl_assoc_from_key_list, tmp_stack); |
| 330 | | | while ((tmp_assoc = ep_stack_pop(tmp_stack)) != NULL) { |
| 331 | | | ssl_association_remove(ssl_associations, tmp_assoc); |
| 332 | | | } |
| 333 | | | |
| 334 | | | |
| 335 | | | ssl_key_hash = g_hash_table_new(ssl_private_key_hash,ssl_private_key_equal); |
| 336 | | | |
| 337 | | | if (ssl_keys_list && (ssl_keys_list[0] != 0)) |
| 338 | | | { |
| 339 | [+] | | if (file_exists(ssl_keys_list)) { |
 |
| 340 | | | if ((ssl_keys_file = ws_fopen(ssl_keys_list, "r"))) { |
Event 9:
Taking true branch. ssl_keys_file = fopen(...) evaluates to true.
hide
|
|
| 341 | | | read_failed = FALSE; |
| 342 | | | fstat(fileno(ssl_keys_file), &statb); |
Event 10:
fileno() returns -1. - Determines the file descriptor in the Negative File Descriptor warning later.
hide
Event 11:
fileno(ssl_keys_file), which evaluates to -1, is passed to fstat() as the first argument. See related event 10.
hide
Negative file descriptor
File descriptor argument fileno(ssl_keys_file) has value -1. - fstat() will fail when called with a negative file descriptor.
The issue can occur if the highlighted code executes. See related event 11. Show: All events | Only primary events |
|
| |