(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/asn1/packet-asn1.c) |
| |
| 2803 | | | read_asn1_type_table(const char *filename) |
| 2804 | | | { |
| 2805 | | | FILE *f; |
| 2806 | | | guint size; |
| 2807 | | | guchar *data; |
| 2808 | | | struct stat stat; |
| 2809 | | | static guint mylogh = 0; |
| 2810 | | | |
| 2811 | | | if ((filename == 0) || (strlen(filename) == 0)) |
Event 1:
Skipping " if". - filename == 0 evaluates to false.
- strlen(filename) == 0 evaluates to false.
hide
|
|
| 2812 | | | return; |
| 2813 | | | |
| 2814 | | | f = ws_fopen(filename, "rb"); |
| 2815 | | | if (f == 0) { |
Event 2:
Skipping " if". f == 0 evaluates to false.
hide
|
|
| 2816 | | | |
| 2817 | | | |
| 2818 | | | |
| 2819 | | | |
| 2820 | | | |
| 2821 | | | |
| 2822 | | | |
| 2823 | | | #ifdef _WIN32 |
| 2824 | | | if (strcmp(filename, bad_separator_old_default_asn1_filename) != 0) |
| 2825 | | | #endif |
| 2826 | | | if ((strcmp(filename, old_default_asn1_filename) != 0) || errno != ENOENT)
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
| 2827 | | | report_open_failure(filename, errno, FALSE); |
| 2828 | | | return; |
| 2829 | | | } |
| 2830 | | | fstat(fileno(f), &stat); |
Event 3:
fileno() returns -1. - Determines the file descriptor in the Negative File Descriptor warning later.
hide
Event 4:
fileno(f), which evaluates to -1, is passed to fstat() as the first argument. See related event 3.
hide
Negative file descriptor
File descriptor argument fileno(f) 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 4. Show: All events | Only primary events |
|
| |