Skip to content

Commit

Permalink
fix build warnings for
Browse files Browse the repository at this point in the history
module-cccam
module-ghttp
oscam-config

git-svn-id: http://www.streamboard.tv/svn/oscam/trunk@11666 4b0bc96b-bc66-0410-9d44-ebda105a78c1
  • Loading branch information
gorgone committed Oct 20, 2020
1 parent fccc51d commit 584302f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
14 changes: 7 additions & 7 deletions module-cccam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ int32_t cc_send_srv_data(struct s_client *cl)

int32_t loop_check(uint8_t *myid, struct s_client *cl)
{
if(!cl)
if(!cl || !myid)
{
return 0;
}
Expand Down Expand Up @@ -2926,7 +2926,7 @@ int32_t cc_parse_msg(struct s_client *cl, uint8_t *buf, int32_t l)
case MSG_NEW_CARD_SIDINFO:
case MSG_NEW_CARD:
{
if(l < 16)
if(l < 16 || !rdr)
{
break;
}
Expand Down Expand Up @@ -3095,7 +3095,8 @@ int32_t cc_parse_msg(struct s_client *cl, uint8_t *buf, int32_t l)
if(config_enabled(WITH_LB) && !cfg.lb_mode)
{
cl->stopped = 1; // server says invalid
rdr->card_status = CARD_FAILURE;
if(rdr)
rdr->card_status = CARD_FAILURE;
}
}
}
Expand Down Expand Up @@ -4204,7 +4205,6 @@ int32_t cc_srv_wakeup_readers(struct s_client *cl)
int32_t wakeup = 0;
struct s_reader *rdr;
struct s_client *client;
struct cc_data *cc;

for(rdr = first_active_reader; rdr; rdr = rdr->next)
{
Expand All @@ -4231,7 +4231,7 @@ int32_t cc_srv_wakeup_readers(struct s_client *cl)
}

// reader is in shutdown
if((client = rdr->client) == NULL || (cc = client->cc) == NULL || client->kill)
if((client = rdr->client) == NULL || (client->cc) == NULL || client->kill)
{
continue;
}
Expand Down Expand Up @@ -4306,7 +4306,7 @@ int32_t cc_srv_connect(struct s_client *cl)

cs_log_dbg(D_TRACE, "receive ccc checksum");

if((i = cc_recv_to(cl, buf, 20)) == 20)
if(cc_recv_to(cl, buf, 20) == 20)
{
//cs_log_dump_dbg(D_CLIENT, buf, 20, "cccam: recv:");
cc_crypt(&cc->block[DECRYPT], buf, 20, DECRYPT);
Expand Down Expand Up @@ -4770,7 +4770,7 @@ int32_t cc_cli_connect(struct s_client *cl)
cc_crypt(&cc->block[ENCRYPT], (uint8_t *)pwd, cs_strlen(pwd), ENCRYPT);
cc_cmd_send(cl, buf, 6, MSG_NO_HEADER); // send 'CCcam' xor w/ pwd

if((n = cc_recv_to(cl, data, 20)) != 20)
if((cc_recv_to(cl, data, 20)) != 20)
{
cs_log("%s login failed, usr/pwd invalid", getprefix());
cc_cli_close(cl, 0);
Expand Down
4 changes: 2 additions & 2 deletions module-ghttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ static char *_ghttp_basic_auth(struct s_client *client)
{
cs_log_dbg(D_CLIENT, "%s: username specified and no existing session, adding basic auth", client->reader->label);
ret = snprintf((char *)auth, sizeof(auth), "%s:%s", client->reader->r_usr, client->reader->r_pwd);
ret = b64encode((char *)auth, ret, &encauth);
b64encode((char *)auth, ret, &encauth);
}
return encauth;
}
Expand Down Expand Up @@ -859,7 +859,7 @@ static int32_t ghttp_capmt_notify(struct s_client *client, struct demux_s *demux
client->reader->label, (pids_len > 0) ? "POST" : "GET", demux->onid, demux->tsid,
demux->program_number, demux->ECMpidcount, demux->ens);

ret = ghttp_send(client, req, ret + pids_len);
ghttp_send(client, req, ret + pids_len);

if(pids_len > 0)
{
Expand Down
12 changes: 5 additions & 7 deletions oscam-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,14 @@ int32_t init_provid(void)
nr = 0;
while(fgets(token, MAXLINESIZE, fp))
{
int32_t i, l;
int32_t i;
struct s_provid *new_provid = NULL;
char *tmp, *ptr1;

tmp = trim(token);

if(tmp[0] == '#') { continue; }
if((l = cs_strlen(tmp)) < 11) { continue; }
if(cs_strlen(tmp) < 11) { continue; }
if(!(payload = strchr(token, '|'))) { continue; }

*payload++ = '\0';
Expand Down Expand Up @@ -519,14 +519,14 @@ int32_t init_srvid(void)

while(fgets(token, MAXLINESIZE, fp))
{
int32_t l, len = 0, len2, srvidtmp;
int32_t len = 0, len2, srvidtmp;
uint32_t k;
uint32_t pos;
char *srvidasc, *prov;
tmp = trim(token);

if(tmp[0] == '#') { continue; }
if((l = cs_strlen(tmp)) < 6) { continue; }
if(cs_strlen(tmp) < 6) { continue; }
if(!(srvidasc = strchr(token, ':'))) { continue; }
if(!(payload = strchr(token, '|'))) { continue; }
*payload++ = '\0';
Expand Down Expand Up @@ -1091,14 +1091,12 @@ int32_t init_tierid(void)
nr = 0;
while(fgets(token, MAXLINESIZE, fp))
{

int32_t l;
void *ptr;
char *tmp, *tieridasc;
tmp = trim(token);

if(tmp[0] == '#') { continue; }
if((l = cs_strlen(tmp)) < 6) { continue; }
if(cs_strlen(tmp) < 6) { continue; }
if(!(payload = strchr(token, '|'))) { continue; }
if(!(tieridasc = strchr(token, ':'))) { continue; }
*payload++ = '\0';
Expand Down

0 comments on commit 584302f

Please sign in to comment.