Changeset 1675


Ignore:
Timestamp:
02/24/10 19:01:34 (11 years ago)
Author:
alno
Message:

WebIf:

  • Merge with trunk up to 1673
Location:
branches/monitor-improvement
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/monitor-improvement/module-cccam.c

    r1662 r1675  
    5353{
    5454  LLIST *l = malloc(sizeof(LLIST));
    55   bzero(l, sizeof(LLIST));
     55  memset(l, 0, sizeof(LLIST));
    5656
    5757  pthread_mutex_init(&l->lock, NULL);
     
    7979    struct llist_node *ln = malloc(sizeof(struct llist_node));
    8080
    81     bzero(ln, sizeof(struct llist_node));
     81    memset(ln, 0, sizeof(struct llist_node));
    8282    ln->obj = o;
    8383
     
    102102  if (l->first) {
    103103
    104     bzero(itr, sizeof(LLIST_ITR));
     104    memset(itr, 0, sizeof(LLIST_ITR));
    105105    itr->cur = l->first;
    106106    itr->l = l;
     
    389389    cc = client[cs_idx].cc;
    390390
    391   bzero(netbuf, len+4);
     391  memset(netbuf, 0, len+4);
    392392
    393393  if (cmd == MSG_NO_HEADER) {
     
    424424
    425425  uint8 buf[CC_MAXMSGSIZE];
    426   bzero(buf, CC_MAXMSGSIZE);
     426  memset(buf, 0, CC_MAXMSGSIZE);
    427427
    428428  memcpy(buf, reader[ridx].r_usr, sizeof(reader[ridx].r_usr));
     
    449449
    450450  uint8 buf[CC_MAXMSGSIZE];
    451   bzero(buf, CC_MAXMSGSIZE);
     451  memset(buf, 0, CC_MAXMSGSIZE);
    452452
    453453  memcpy(buf, cc->node_id, 8 );
     
    573573  if (cc->cur_card) {
    574574    uint8 *ecmbuf = malloc(cur_er->l+13);
    575     bzero(ecmbuf, cur_er->l+13);
     575    memset(ecmbuf, 0, cur_er->l+13);
    576576
    577577    // build ecm message
     
    679679      struct cc_card *card = malloc(sizeof(struct cc_card));
    680680
    681       bzero(card, sizeof(struct cc_card));
     681      memset(card, 0, sizeof(struct cc_card));
    682682
    683683      card->provs = llist_create();
     
    752752      cs_debug("   added sid block for card %08x", cc->cur_card->id);
    753753    }
    754     bzero(cc->dcw, 16);
     754    memset(cc->dcw, 0, 16);
    755755    pthread_mutex_unlock(&cc->ecm_busy);
    756756    cc_send_ecm(NULL, NULL);
     
    762762
    763763      cc->cur_card = malloc(sizeof(struct cc_card));
    764       bzero(cc->cur_card, sizeof(struct cc_card));
     764      memset(cc->cur_card, 0, sizeof(struct cc_card));
    765765
    766766      cc->cur_card->id = buf[10] << 24 | buf[11] << 16 | buf[12] << 8 | buf[13];
     
    829829  struct cc_data *cc;
    830830
    831   bzero(buf, sizeof(buf));
     831  memset(buf, 0, sizeof(buf));
    832832
    833833  if(er->rc<=3) {
     
    912912  }
    913913  reader[ridx].cc = cc;
    914   bzero(reader[ridx].cc, sizeof(struct cc_data));
     914  memset(reader[ridx].cc, 0, sizeof(struct cc_data));
    915915  cc->cards = llist_create();
    916916
     
    951951  cc_cmd_send(hash, 20, MSG_NO_HEADER);   // send crypted hash to server
    952952
    953   bzero(buf, sizeof(buf));
     953  memset(buf, 0, sizeof(buf));
    954954  memcpy(buf, reader[ridx].r_usr, strlen(reader[ridx].r_usr));
    955955  cs_ddump(buf, 20, "cccam: username '%s':", buf);
    956956  cc_cmd_send(buf, 20, MSG_NO_HEADER);    // send usr '0' padded -> 20 bytes
    957957
    958   bzero(buf, sizeof(buf));
    959   bzero(pwd, sizeof(pwd));
     958  memset(buf, 0, sizeof(buf));
     959  memset(pwd, 0, sizeof(pwd));
    960960
    961961  cs_debug("cccam: 'CCcam' xor");
     
    10181018  for (r=0; r<CS_MAXREADER; r++) {
    10191019    if (reader[r].caid[0]) {
    1020       bzero(buf, sizeof(buf));
     1020      memset(buf, 0, sizeof(buf));
    10211021
    10221022      buf[0] = id >> 24;
     
    10451045      for (j=0; j<CS_MAXFILTERS; j++) {
    10461046        if (reader[r].ftab.filts[j].caid) {
    1047           bzero(buf, sizeof(buf));
     1047          memset(buf, 0, sizeof(buf));
    10481048
    10491049          buf[0] = id >> 24;
     
    10861086  struct cc_data *cc;
    10871087
    1088   bzero(usr, sizeof(usr));
    1089   bzero(pwd, sizeof(pwd));
     1088  memset(usr, 0, sizeof(usr));
     1089  memset(pwd, 0, sizeof(pwd));
    10901090
    10911091  if (client[cs_idx].cc) NULLFREE(client[cs_idx].cc);
     
    10991099
    11001100  client[cs_idx].cc = cc;
    1101   bzero(client[cs_idx].cc, sizeof(struct cc_data));
     1101  memset(client[cs_idx].cc, 0, sizeof(struct cc_data));
    11021102
    11031103  // calc + send random seed
     
    11391139
    11401140  for (account=cfg->account; account; account=account->next)
    1141     if (!strcmp(usr, account->usr)) break;
    1142 
    1143   strncpy(pwd, cfg->account->pwd, sizeof(pwd));
     1141    if (strcmp(usr, account->usr) == 0) {
     1142      strncpy(pwd, account->pwd, sizeof(pwd));
     1143      break;
     1144    }
    11441145
    11451146  // receive passwd / 'CCcam'
     
    11541155
    11551156  // send passwd ack
    1156   bzero(buf, 20);
     1157  memset(buf, 0, 20);
    11571158  memcpy(buf, "CCcam\0", 6);
    11581159  cs_ddump(buf, 20, "cccam: send ack:");
     
    11611162
    11621163  // recv cli data
    1163   bzero(buf,sizeof(buf));
     1164  memset(buf, 0, sizeof(buf));
    11641165  i = cc_msg_recv(buf);
    11651166  cs_ddump(buf, i, "cccam: cli data:");
  • branches/monitor-improvement/module-radegast.c

    r1662 r1675  
    174174  uchar header[22] = "\x02\x01\x00\x06\x08\x30\x30\x30\x30\x30\x30\x30\x30\x07\x04\x30\x30\x30\x38\x08\x01\x02";
    175175  uchar *ecmbuf = malloc(er->l + 30);
    176   bzero(ecmbuf, er->l + 30);
     176  memset(ecmbuf, 0, er->l + 30);
    177177
    178178  ecmbuf[0] = 1;
     
    240240  if ((client[cs_idx].udp_fd=socket(PF_INET, SOCK_STREAM, p_proto))<0)
    241241  {
    242     cs_log("cccam: Socket creation failed (errno=%d)", errno);
     242    cs_log("radegast: Socket creation failed (errno=%d)", errno);
    243243    cs_exit(1);
    244244  }
  • branches/monitor-improvement/oscam-config.c

    r1668 r1675  
    565565      exit(1);
    566566    }
    567     bzero(cfg->cc_version, sizeof(cfg->cc_version));
     567    memset(cfg->cc_version, 0, sizeof(cfg->cc_version));
    568568    strncpy((char*)cfg->cc_version, value, sizeof(cfg->cc_version)-1);
    569569    return;
     
    574574      exit(1);
    575575    }
    576     bzero(cfg->cc_build, sizeof(cfg->cc_build));
     576    memset(cfg->cc_build, 0, sizeof(cfg->cc_build));
    577577    strncpy((char*)cfg->cc_build, value, sizeof(cfg->cc_build)-1);
    578578    return;
     
    18241824      exit(1);
    18251825    }
    1826     bzero(rdr->cc_version, sizeof(rdr->cc_version));
     1826    memset(rdr->cc_version, 0, sizeof(rdr->cc_version));
    18271827    cs_strncpy(rdr->cc_version, value, sizeof(rdr->cc_version));
    18281828    return;
     
    18331833      exit(1);
    18341834    }
    1835     bzero(rdr->cc_build, sizeof(rdr->cc_build));
     1835    memset(rdr->cc_build, 0, sizeof(rdr->cc_build));
    18361836    cs_strncpy(rdr->cc_build, value, sizeof(rdr->cc_build));
    18371837    return;
Note: See TracChangeset for help on using the changeset viewer.