Redundant Condition at tap-protohierstat.c:202 |
No properties have been set. edit properties |
Jump to warning location ↓ | warning details... |
| |
protohierstat_init (/home/sate/Testcases/c/cve/wireshark-1.2.0/tap-protohierstat.c)![]() | ||||||
![]() | ||||||
176 | protohierstat_init(const char *optarg, void* userdata _U_) | |||||
177 | { | |||||
178 | phs_t *rs; | |||||
179 | int pos=0; | |||||
180 | const char *filter=NULL; | |||||
181 | GString *error_string; | |||||
182 | ||||||
183 | if(!strcmp("io,phs",optarg)){ | |||||
184 | filter="frame"; | |||||
185 | } else if(sscanf(optarg,"io,phs,%n",&pos)==0){ | |||||
186 | if(pos){ | |||||
187 | filter=optarg+pos; | |||||
188 | } else { | |||||
189 | /* We must use a filter to guarantee that edt->tree | |||||
190 | will be populated. "frame" matches everything so | |||||
191 | that one is used instead of no filter. | |||||
192 | */ | |||||
193 | filter="frame"; | |||||
194 | } | |||||
195 | } else { | |||||
196 | fprintf(stderr, "tshark: invalid \"-z io,phs[,<filter>]\" argument\n"); | |||||
197 | exit(1); | |||||
198 | } | |||||
199 | ||||||
200 | rs=new_phs_t(NULL); | |||||
201 | ||||||
202 | if(filter){
| |||||
203 | rs->filter=g_strdup(filter); | |||||
204 | } else { | |||||
205 | rs->filter=NULL; | |||||
206 | } | |||||
207 | ||||||
208 | error_string=register_tap_listener("frame", rs, filter, NULL, protohierstat_packet, protohierstat_draw); | |||||
209 | if(error_string){ | |||||
210 | /* error, we failed to attach to the tap. clean up */ | |||||
211 | g_free(rs->filter); | |||||
212 | g_free(rs); | |||||
213 | ||||||
214 | fprintf(stderr, "tshark: Couldn't register io,phs tap: %s\n", | |||||
215 | error_string->str); | |||||
216 | g_string_free(error_string, TRUE); | |||||
217 | exit(1); | |||||
218 | } | |||||
219 | } | |||||
![]() |