Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Computation  at gcp.c:349

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

gcp_cmd

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/gcp.c)expand/collapse
Show more  
 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);
 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!");
 348   
 349              return NULL;
 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  }
Show more  




Change Warning 2729.30545 : Unreachable Computation

Priority:
State:
Finding:
Owner:
Note: