Commit f4a681be authored by Youness Alaoui's avatar Youness Alaoui

Fix coverity issues, remove possibly NULL dereferencing

parent 5662e1b0
......@@ -1780,7 +1780,12 @@ nice_agent_gather_candidates (
for (n = 0; n < stream->n_components; n++) {
Component *component = stream_find_component_by_id (stream, n + 1);
guint current_port = component->min_port;
guint current_port;
if (component == NULL)
continue;
current_port = component->min_port;
if (agent->reliable && component->tcp == NULL) {
nice_debug ("Agent %p: not gathering candidates for s%d:%d because "
......
......@@ -969,8 +969,11 @@ process(PseudoTcpSocket *self, Segment *seg)
//LOG(LS_INFO) << "PseudoTcp::process - priv->slen = " << priv->slen;
for (nFree = nAcked; nFree > 0; ) {
SSegment *data = (SSegment *) (g_list_first (priv->slist)->data);
g_assert(g_list_length (priv->slist) > 0);
SSegment *data;
g_assert(priv->slist != NULL);
data = (SSegment *) (priv->slist->data);
if (nFree < data->len) {
data->len -= nFree;
nFree = 0;
......
......@@ -126,7 +126,8 @@ stun_message_find (const StunMessage *msg, StunAttribute type,
return NULL;
}
if (!(msg->agent->usage_flags & STUN_AGENT_USAGE_NO_ALIGNED_ATTRIBUTES))
if (!(msg->agent &&
(msg->agent->usage_flags & STUN_AGENT_USAGE_NO_ALIGNED_ATTRIBUTES)))
alen = stun_align (alen);
offset += alen;
......@@ -342,7 +343,8 @@ stun_message_append (StunMessage *msg, StunAttribute type, size_t length)
a = msg->buffer + mlen;
a = stun_setw (a, type);
if (msg->agent->usage_flags & STUN_AGENT_USAGE_NO_ALIGNED_ATTRIBUTES)
if (msg->agent &&
(msg->agent->usage_flags & STUN_AGENT_USAGE_NO_ALIGNED_ATTRIBUTES))
{
a = stun_setw (a, length);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment