Unreachable Data Flow at airopeek9.c:124 |
No properties have been set. edit properties |
Jump to warning location ↓ | warning details... |
| |
wtap_file_read_pattern (/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/airopeek9.c)![]() | ||||||
![]() | ||||||
94 | static int wtap_file_read_pattern (wtap *wth, const char *pattern, int *err) | |||||
95 | { | |||||
96 | int c; | |||||
97 | const char *cp; | |||||
98 | ||||||
99 | cp = pattern; | |||||
100 | while (*cp) | |||||
101 | { | |||||
102 | c = file_getc(wth->fh); | |||||
103 | if (c == EOF) { | |||||
104 | if (file_eof(wth->fh)) | |||||
105 | return 0; /* EOF */ | |||||
106 | else { | |||||
107 | /* We (presumably) got an error (there's no equivalent to | |||||
108 | "ferror()" in zlib, alas, so we don't have a wrapper | |||||
109 | to check for an error). */ | |||||
110 | *err = file_error(wth->fh); | |||||
111 | return -1; /* error */ | |||||
112 | } | |||||
113 | } | |||||
114 | if (c == *cp) | |||||
115 | cp++; | |||||
116 | else | |||||
117 | { | |||||
118 | if (c == pattern[0]) | |||||
119 | cp = &pattern[1]; | |||||
120 | else | |||||
121 | cp = pattern; | |||||
122 | } | |||||
123 | } | |||||
124 | return (*cp == '\0' ? 1 : 0);
| |||||
125 | } | |||||
![]() |