Skip to content

Commit

Permalink
Fix coverity warning
Browse files Browse the repository at this point in the history
  • Loading branch information
trengginas committed Jun 26, 2024
1 parent 8c8675d commit 7c7fb13
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pjlib/src/pjlib-test/ioq_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ static int compliance_test_2(const pj_ioqueue_cfg *cfg)
if (client[i].key != NULL) {
pj_ioqueue_unregister(client[i].key);
client[i].key = NULL;
server[i].sock = PJ_INVALID_SOCKET;
client[i].sock = PJ_INVALID_SOCKET;
} else if (client[i].sock != PJ_INVALID_SOCKET) {
pj_sock_close(client[i].sock);
client[i].sock = PJ_INVALID_SOCKET;
Expand Down
6 changes: 4 additions & 2 deletions pjmedia/src/pjmedia/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,10 @@ pjmedia_endpt_create_video_sdp(pjmedia_endpt *endpt,
continue;
}

pjmedia_vid_codec_mgr_get_default_param(NULL, &codec_info[i],
&codec_param);
status = pjmedia_vid_codec_mgr_get_default_param(NULL, &codec_info[i],
&codec_param);
if (status != PJ_SUCCESS)
return status;

fmt = &m->desc.fmt[m->desc.fmt_count++];
fmt->ptr = (char*) pj_pool_alloc(pool, 8);
Expand Down
2 changes: 1 addition & 1 deletion pjmedia/src/pjmedia/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -2895,7 +2895,7 @@ PJ_DEF(pj_status_t) pjmedia_stream_create( pjmedia_endpt *endpt,
pj_sockaddr_cp(&stream->rem_rtp_addr, &info->rem_addr);
if (stream->si.rtcp_mux) {
pj_sockaddr_cp(&att_param.rem_rtcp, &info->rem_addr);
} else if (pj_sockaddr_has_addr(&info->rem_rtcp.addr)) {
} else if (pj_sockaddr_has_addr(&info->rem_rtcp)) {
pj_sockaddr_cp(&att_param.rem_rtcp, &info->rem_rtcp);
}
att_param.addr_len = pj_sockaddr_get_len(&info->rem_addr);
Expand Down
6 changes: 6 additions & 0 deletions pjsip/src/pjsip-ua/sip_100rel.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ PJ_DEF(pj_status_t) pjsip_100rel_create_prack( pjsip_inv_session *inv,
}
rseq = (pj_uint32_t) pj_strtoul(&rseq_hdr->hvalue);

if (rseq < 1) {
PJ_LOG(4, (dd->inv->dlg->obj_name,
"Ignoring 100rel response RSeq header value less than 1"));
return PJSIP_EINVALIDMSG;
}

/* Find UAC state for the specified call leg */
uac_state = dd->uac_state_list;
while (uac_state) {
Expand Down

0 comments on commit 7c7fb13

Please sign in to comment.