(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/gcp.c) |
| |
| 329 | | | gcp_cmd_t* gcp_cmd(gcp_msg_t* m, gcp_trx_t* t, gcp_ctx_t* c, gcp_cmd_type_t type, guint offset, gboolean persistent) { |
| 330 | | | gcp_cmd_t* cmd; |
| 331 | | | gcp_cmd_msg_t* cmdtrx; |
| 332 | | | gcp_cmd_msg_t* cmdctx; |
| 333 | | | |
| 334 | | | if ( !m || !t || !c) return NULL; |
| 335 | | | |
| 336 | | | if (persistent) { |
| 337 | | | if (m->commited) { |
| 338 | | | DISSECTOR_ASSERT(t->cmds != NULL);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
117 | #define DISSECTOR_ASSERT(expression) \ |
118 | ((void) ((expression) ? (void)0 : \ |
119 | __DISSECTOR_ASSERT (expression, __FILE__, __LINE__))) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
138 | #define __DISSECTOR_ASSERT(expression, file, lineno) \ |
139 | (REPORT_DISSECTOR_BUG( \ |
140 | ep_strdup_printf("%s:%u: failed assertion \"%s\"", \ |
141 | file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression)))) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
106 | #define REPORT_DISSECTOR_BUG(message) \ |
107 | ((getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL) ? \ |
108 | abort() : \ |
109 | THROW_MESSAGE(DissectorError, message)) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
226 | #define THROW_MESSAGE(x, y) \ |
227 | except_throw(XCEPT_GROUP_WIRESHARK, (x), (y)) |
| |
|
| 339 | | | |
| 340 | | | for (cmdctx = t->cmds; cmdctx; cmdctx = cmdctx->next) { |
| 341 | | | cmd = cmdctx->cmd; |
| 342 | | | if (cmd->msg == m && cmd->offset == offset) { |
| 343 | | | return cmd; |
| 344 | | | } |
| 345 | | | } |
| 346 | | | |
| 347 | | | DISSECTOR_ASSERT(!"called for a command that does not exist!");
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
117 | #define DISSECTOR_ASSERT(expression) \ |
118 | ((void) ((expression) ? (void)0 : \ |
119 | __DISSECTOR_ASSERT (expression, __FILE__, __LINE__))) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
138 | #define __DISSECTOR_ASSERT(expression, file, lineno) \ |
139 | (REPORT_DISSECTOR_BUG( \ |
140 | ep_strdup_printf("%s:%u: failed assertion \"%s\"", \ |
141 | file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression)))) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
106 | #define REPORT_DISSECTOR_BUG(message) \ |
107 | ((getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL) ? \ |
108 | abort() : \ |
109 | THROW_MESSAGE(DissectorError, message)) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
226 | #define THROW_MESSAGE(x, y) \ |
227 | except_throw(XCEPT_GROUP_WIRESHARK, (x), (y)) |
| |
|
| 348 | | | |
| 349 | | | return NULL; |
Unreachable Computation
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 350 | | | } else { |
| 351 | | | cmd = se_alloc(sizeof(gcp_cmd_t)); |
| 352 | | | cmdtrx = se_alloc(sizeof(gcp_cmd_msg_t)); |
| 353 | | | cmdctx = se_alloc(sizeof(gcp_cmd_msg_t)); |
| 354 | | | } |
| 355 | | | } else { |
| 356 | | | cmd = ep_new(gcp_cmd_t); |
| 357 | | | cmdtrx = ep_new(gcp_cmd_msg_t); |
| 358 | | | cmdctx = ep_new(gcp_cmd_msg_t); |
| 359 | | | } |
| 360 | | | |
| 361 | | | cmd->type = type; |
| 362 | | | cmd->offset = offset; |
| 363 | | | cmd->terms.term = NULL; |
| 364 | | | cmd->terms.next = NULL; |
| 365 | | | cmd->terms.last = &(cmd->terms); |
| 366 | | | cmd->str = NULL; |
| 367 | | | cmd->msg = m; |
| 368 | | | cmd->trx = t; |
| 369 | | | cmd->ctx = c; |
| 370 | | | cmd->error = 0; |
| 371 | | | |
| 372 | | | cmdctx->cmd = cmdtrx->cmd = cmd; |
| 373 | | | cmdctx->next = cmdtrx->next = NULL; |
| 374 | | | cmdctx->last = cmdtrx->last = NULL; |
| 375 | | | |
| 376 | | | if (t->cmds) { |
| 377 | | | t->cmds->last->next = cmdtrx; |
| 378 | | | t->cmds->last = cmdtrx; |
| 379 | | | } else { |
| 380 | | | t->cmds = cmdtrx; |
| 381 | | | t->cmds->last = cmdtrx; |
| 382 | | | } |
| 383 | | | |
| 384 | | | if (c->cmds) { |
| 385 | | | c->cmds->last->next = cmdctx; |
| 386 | | | c->cmds->last = cmdctx; |
| 387 | | | } else { |
| 388 | | | c->cmds = cmdctx; |
| 389 | | | c->cmds->last = cmdctx; |
| 390 | | | } |
| 391 | | | |
| 392 | | | return cmd; |
| 393 | | | } |
| |