(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/etherpeek.c) |
| |
| 159 | | | int etherpeek_open(wtap *wth, int *err, gchar **err_info _U_) |
| 160 | | | { |
| 161 | | | ep_hdr; |
| 162 | | | struct timeval reference_time; |
| 163 | | | int file_encap; |
| 164 | | | |
| 165 | | | |
| 166 | | | |
| 167 | | | |
| 168 | | | |
| 169 | | | |
| 170 | | | |
| 171 | | | |
| 172 | | | |
| 173 | | | g_assert(sizeof(ep_hdr.master) == ETHERPEEK_MASTER_HDR_SIZE);
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
74 | #define g_assert(expr) do { if G_LIKELY (expr) ; else \ |
75 | g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ |
76 | #expr); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
277 | #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1)) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
268 | #define _G_BOOLEAN_EXPR(expr) \ |
269 | __extension__ ({ \ |
270 | int _g_boolean_var_; \ |
271 | if (expr) \ |
272 | _g_boolean_var_ = 1; \ |
273 | else \ |
274 | _g_boolean_var_ = 0; \ |
275 | _g_boolean_var_; \ |
276 | }) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 174 | | | wtap_file_read_unknown_bytes(
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
454 | #define wtap_file_read_unknown_bytes(target, num_bytes, fh, err) \ |
455 | G_STMT_START \ |
456 | { \ |
457 | int _bytes_read; \ |
458 | _bytes_read = file_read((target), 1, (num_bytes), (fh)); \ |
459 | if (_bytes_read != (int) (num_bytes)) { \ |
460 | *(err) = file_error((fh)); \ |
461 | return FALSE; \ |
462 | } \ |
463 | } \ |
464 | G_STMT_END |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/file_wrappers.h |
| |
36 | #define file_read(buf, bsize, count, file) gzread((file),(buf),(unsigned)((count)*(bsize))) |
| |
|
| 175 | | | &ep_hdr.master, sizeof(ep_hdr.master), wth->fh, err); |
| 176 | | | wth->data_offset += sizeof(ep_hdr.master); |
| 177 | | | |
| 178 | | | |
| 179 | | | |
| 180 | | | |
| 181 | | | |
| 182 | | | |
| 183 | | | |
| 184 | | | |
| 185 | | | |
| 186 | | | |
| 187 | | | |
| 188 | | | |
| 189 | | | |
| 190 | | | ep_hdr.master.version &= ~0x80; |
| 191 | | | |
| 192 | | | |
| 193 | | | switch (ep_hdr.master.version) { |
| 194 | | | |
| 195 | | | case 5: |
| 196 | | | case 6: |
| 197 | | | case 7: |
| 198 | | | |
| 199 | | | g_assert(sizeof(ep_hdr.secondary.v567) ==
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
74 | #define g_assert(expr) do { if G_LIKELY (expr) ; else \ |
75 | g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ |
76 | #expr); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
277 | #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1)) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
268 | #define _G_BOOLEAN_EXPR(expr) \ |
269 | __extension__ ({ \ |
270 | int _g_boolean_var_; \ |
271 | if (expr) \ |
272 | _g_boolean_var_ = 1; \ |
273 | else \ |
274 | _g_boolean_var_ = 0; \ |
275 | _g_boolean_var_; \ |
276 | }) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 200 | | | ETHERPEEK_V567_HDR_SIZE); |
| 201 | | | wtap_file_read_unknown_bytes(
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
454 | #define wtap_file_read_unknown_bytes(target, num_bytes, fh, err) \ |
455 | G_STMT_START \ |
456 | { \ |
457 | int _bytes_read; \ |
458 | _bytes_read = file_read((target), 1, (num_bytes), (fh)); \ |
459 | if (_bytes_read != (int) (num_bytes)) { \ |
460 | *(err) = file_error((fh)); \ |
461 | return FALSE; \ |
462 | } \ |
463 | } \ |
464 | G_STMT_END |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/file_wrappers.h |
| |
36 | #define file_read(buf, bsize, count, file) gzread((file),(buf),(unsigned)((count)*(bsize))) |
| |
|
| 202 | | | &ep_hdr.secondary.v567, |
| 203 | | | sizeof(ep_hdr.secondary.v567), wth->fh, err); |
| 204 | | | wth->data_offset += sizeof(ep_hdr.secondary.v567); |
| 205 | | | |
| 206 | | | if ((0 != ep_hdr.secondary.v567.reserved[0]) || |
| 207 | | | (0 != ep_hdr.secondary.v567.reserved[1]) || |
| 208 | | | (0 != ep_hdr.secondary.v567.reserved[2])) { |
| 209 | | | |
| 210 | | | return 0; |
| 211 | | | } |
| 212 | | | |
| 213 | | | |
| 214 | | | |
| 215 | | | |
| 216 | | | |
| 217 | | | |
| 218 | | | |
| 219 | | | |
| 220 | | | |
| 221 | | | ep_hdr.secondary.v567.mediaType = |
| 222 | | | g_ntohl(ep_hdr.secondary.v567.mediaType);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
347 | #define g_ntohl(val) (GUINT32_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
322 | #define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 223 | | | ep_hdr.secondary.v567.physMedium = |
| 224 | | | g_ntohl(ep_hdr.secondary.v567.physMedium);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
347 | #define g_ntohl(val) (GUINT32_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
322 | #define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 225 | | | |
| 226 | | | switch (ep_hdr.secondary.v567.physMedium) { |
| 227 | | | |
| 228 | | | case 0: |
| 229 | | | |
| 230 | | | |
| 231 | | | |
| 232 | | | |
| 233 | | | switch (ep_hdr.secondary.v567.mediaType) { |
| 234 | | | |
| 235 | | | case 0: |
| 236 | | | file_encap = WTAP_ENCAP_ETHERNET; |
| 237 | | | break; |
| 238 | | | |
| 239 | | | case 1: |
| 240 | | | file_encap = WTAP_ENCAP_TOKEN_RING; |
| 241 | | | break; |
| 242 | | | |
| 243 | | | default: |
| 244 | | | |
| 245 | | | |
| 246 | | | |
| 247 | | | return 0; |
| 248 | | | } |
| 249 | | | break; |
| 250 | | | |
| 251 | | | case 1: |
| 252 | | | switch (ep_hdr.secondary.v567.mediaType) { |
| 253 | | | |
| 254 | | | case 0: |
| 255 | | | |
| 256 | | | |
| 257 | | | |
| 258 | | | |
| 259 | | | |
| 260 | | | |
| 261 | | | |
| 262 | | | |
| 263 | | | |
| 264 | | | |
| 265 | | | file_encap = WTAP_ENCAP_IEEE_802_11_WITH_RADIO; |
| 266 | | | break; |
| 267 | | | |
| 268 | | | default: |
| 269 | | | |
| 270 | | | |
| 271 | | | |
| 272 | | | return 0; |
| 273 | | | } |
| 274 | | | break; |
| 275 | | | |
| 276 | | | default: |
| 277 | | | |
| 278 | | | |
| 279 | | | |
| 280 | | | return 0; |
| 281 | | | } |
| 282 | | | |
| 283 | | | |
| 284 | | | |
| 285 | | | |
| 286 | | | |
| 287 | | | |
| 288 | | | |
| 289 | | | |
| 290 | | | |
| 291 | | | ep_hdr.secondary.v567.filelength = |
| 292 | | | g_ntohl(ep_hdr.secondary.v567.filelength);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
347 | #define g_ntohl(val) (GUINT32_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
322 | #define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 293 | | | ep_hdr.secondary.v567.numPackets = |
| 294 | | | g_ntohl(ep_hdr.secondary.v567.numPackets);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
347 | #define g_ntohl(val) (GUINT32_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
322 | #define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 295 | | | ep_hdr.secondary.v567.timeDate = |
| 296 | | | g_ntohl(ep_hdr.secondary.v567.timeDate);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
347 | #define g_ntohl(val) (GUINT32_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
322 | #define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 297 | | | ep_hdr.secondary.v567.timeStart = |
| 298 | | | g_ntohl(ep_hdr.secondary.v567.timeStart);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
347 | #define g_ntohl(val) (GUINT32_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
322 | #define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 299 | | | ep_hdr.secondary.v567.timeStop = |
| 300 | | | g_ntohl(ep_hdr.secondary.v567.timeStop);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
347 | #define g_ntohl(val) (GUINT32_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
322 | #define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 301 | | | ep_hdr.secondary.v567.appVers = |
| 302 | | | g_ntohl(ep_hdr.secondary.v567.appVers);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
347 | #define g_ntohl(val) (GUINT32_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
322 | #define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 303 | | | ep_hdr.secondary.v567.linkSpeed = |
| 304 | | | g_ntohl(ep_hdr.secondary.v567.linkSpeed);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
347 | #define g_ntohl(val) (GUINT32_FROM_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
322 | #define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 305 | | | |
| 306 | | | |
| 307 | | | reference_time.tv_sec = |
| 308 | | | ep_hdr.secondary.v567.timeDate - mac2unix; |
| 309 | | | reference_time.tv_usec = 0; |
| 310 | | | break; |
| 311 | | | |
| 312 | | | default: |
| 313 | | | |
| 314 | | | |
| 315 | | | |
| 316 | | | return 0; |
| 317 | | | } |
| 318 | | | |
| 319 | | | |
| 320 | | | |
| 321 | | | |
| 322 | | | |
| 323 | | | |
| 324 | | | |
| 325 | | | wth->capture.etherpeek = g_malloc(sizeof(etherpeek_t)); |
| 326 | | | wth->capture.etherpeek->reference_time = reference_time; |
| 327 | | | wth->subtype_close = etherpeek_close; |
| 328 | | | switch (ep_hdr.master.version) { |
Redundant Condition
In switch(ep_hdr.master.version), the default case will never be executed. This may be because: - There is a constant assignment to one or more of the variables involved.
- An earlier conditional statement has already ensured that this case cannot occur.
- A crashing bug occurs on every path where this case would have been executed. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 329 | | | |
| 330 | | | case 5: |
| 331 | | | case 6: |
| 332 | | | wth->file_type = WTAP_FILE_ETHERPEEK_V56; |
| 333 | | | |
| 334 | | | |
| 335 | | | |
| 336 | | | |
| 337 | | | wth->file_encap = WTAP_ENCAP_PER_PACKET; |
| 338 | | | wth->subtype_read = etherpeek_read_v56; |
| 339 | | | wth->subtype_seek_read = etherpeek_seek_read_v56; |
| 340 | | | break; |
| 341 | | | |
| 342 | | | case 7: |
| 343 | | | wth->file_type = WTAP_FILE_ETHERPEEK_V7; |
| 344 | | | wth->file_encap = file_encap; |
| 345 | | | wth->subtype_read = etherpeek_read_v7; |
| 346 | | | wth->subtype_seek_read = etherpeek_seek_read_v7; |
| 347 | | | break; |
| 348 | | | |
| 349 | | | default: |
| 350 | | | |
| 351 | | | g_assert_not_reached();
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
73 | #define g_assert_not_reached() do { g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 352 | | | } |
| 353 | | | |
| 354 | | | wth->snapshot_length = 0; |
| 355 | | | wth->tsprecision = WTAP_FILE_TSPREC_USEC; |
| 356 | | | |
| 357 | | | return 1; |
| 358 | | | } |
| |