(/home/sate/Testcases/c/cve/wireshark-1.2.0/capture_opts.c) |
| |
| 373 | | | capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg) |
| 374 | | | { |
| 375 | | | long adapter_index; |
| 376 | | | char *p; |
| 377 | | | GList *if_list; |
| 378 | | | if_info_t *if_info; |
| 379 | | | int err; |
| 380 | | | gchar *err_str; |
| 381 | | | |
| 382 | | | |
| 383 | | | |
| 384 | | | |
| 385 | | | |
| 386 | | | |
| 387 | | | |
| 388 | | | |
| 389 | | | |
| 390 | | | |
| 391 | | | adapter_index = strtol(optarg, &p, 10); |
| 392 | | | if (p != NULL && *p == '\0') { |
Event 1:
Taking true branch. - p != (void *)0 evaluates to true.
- *p == 0 evaluates to true.
hide
|
|
| 393 | | | if (adapter_index < 0) { |
Event 2:
Skipping " if". adapter_index < 0 evaluates to false.
hide
|
|
| 394 | | | cmdarg_err("The specified adapter index is a negative number"); |
| 395 | | | return 1; |
| 396 | | | } |
| 397 | | | if (adapter_index > INT_MAX) { |
Event 3:
Skipping " if". adapter_index > 2147483647 evaluates to false.
hide
|
|
| 398 | | | cmdarg_err("The specified adapter index is too large (greater than %d)", |
| 399 | | | INT_MAX); |
| 400 | | | return 1; |
| 401 | | | } |
| 402 | | | if (adapter_index == 0) { |
Event 4:
Skipping " if". adapter_index == 0 evaluates to false.
hide
|
|
| 403 | | | cmdarg_err("There is no interface with that adapter index"); |
| 404 | | | return 1; |
| 405 | | | } |
| 406 | [+] | | if_list = get_interface_list(&err, &err_str); |
Event 5:
get_interface_list() does not initialize err_str. - This may be because of a failure case or other special case for get_interface_list().
hide
|
|
 |
| 407 | | | if (if_list == NULL) { |
Event 14:
Taking true branch. if_list == (void *)0 evaluates to true.
hide
|
|
| 408 | | | switch (err) { |
Event 15:
err evaluates to 1.
hide
|
|
| 409 | | | |
| 410 | | | case CANT_GET_INTERFACE_LIST: |
| 411 | | | cmdarg_err("%s", err_str); |
Uninitialized Variable
err_str was not initialized. The issue can occur if the highlighted code executes. See related events 5 and 6. Show: All events | Only primary events |
|
| |