(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/diam_dict.c) |
| |
| 3044 | | | static FILE* ddict_open(const char* system_directory, const char* filename) { |
| 3045 | | | FILE* fh; |
| 3046 | | | char* fname; |
| 3047 | | | if (system_directory) { |
Event 1:
Taking false branch. system_directory evaluates to false.
hide
|
|
| 3048 | | | fname = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", |
| 3049 | | | system_directory,filename); |
| 3050 | | | } else { |
| 3051 | | | fname = strdup(filename); |
Event 2:
strdup() returns NULL. - Dereferenced later, causing the null pointer dereference.
hide
Event 3:
fname is set to strdup(filename), which evaluates to NULL. See related event 2.
hide
|
|
| 3052 | | | } |
| 3053 | | | |
| 3054 | | | fh = ws_fopen(fname,"r"); |
Event 4:
fname, which evaluates to NULL, is passed to fopen() as the first argument. See related event 3.
hide
Null Pointer Dereference
The body of fopen() dereferences fname, but it is NULL. The issue can occur if the highlighted code executes. See related event 4. Show: All events | Only primary events |
|
| |