(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/file_access.c) |
| |
| 886 | | | static gboolean wtap_dump_open_finish(wtap_dumper *wdh, int filetype, gboolean compressed, int *err) |
| 887 | | | { |
| 888 | | | int fd; |
| 889 | | | gboolean cant_seek; |
| 890 | | | |
| 891 | | | |
| 892 | | | |
| 893 | | | if(compressed) { |
| 894 | | | cant_seek = TRUE; |
| 895 | | | } else { |
| 896 | | | fd = fileno(wdh->fh); |
| 897 | | | if (lseek(fd, 1, SEEK_CUR) == -1)
x /usr/include/fcntl.h |
| |
101 | # define SEEK_CUR 1 /* Seek from current position. */ |
| |
|
| 898 | | | cant_seek = TRUE; |
| 899 | | | else { |
| 900 | | | |
| 901 | | | lseek(fd, 0, SEEK_SET);
x /usr/include/fcntl.h |
| |
100 | # define SEEK_SET 0 /* Seek from beginning of file. */ |
| |
|
Ignored Return Value
The return value of lseek() is never checked in the highlighted execution scenario. - If the return value can indicate an error, the error will be ignored if the highlighted code executes.
- CodeSonar is configured to enforce Ignored Return Value checks for lseek(). (To change the set of enforced Ignored Return Value checks, use configuration file parameters RETURN_CHECKER_CHECKED_FUNCS and RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 902 | | | cant_seek = FALSE; |
| 903 | | | } |
| 904 | | | } |
| 905 | | | |
| 906 | | | |
| 907 | | | if (!(*dump_open_table[filetype].dump_open)(wdh, cant_seek, err)) { |
Event 2:
Skipping " if". (*dump_open_table[filetype].dump_open)(...) evaluates to true.
hide
|
|
| 908 | | | return FALSE; |
| 909 | | | } |
| 910 | | | |
| 911 | | | return TRUE; |
Event 3:
!0 evaluates to true.
hide
|
|
| 912 | | | } |
| |