Commit cbf17ada authored by Olivier Crête's avatar Olivier Crête

conncheck: Avoid reading null username

parent 43466b3b
...@@ -2664,7 +2664,8 @@ static bool conncheck_stun_validater (StunAgent *agent, ...@@ -2664,7 +2664,8 @@ static bool conncheck_stun_validater (StunAgent *agent,
stun_debug ("' (%d) with '", username_len); stun_debug ("' (%d) with '", username_len);
stun_debug_bytes (ufrag, ufrag_len); stun_debug_bytes (ufrag, ufrag_len);
stun_debug ("' (%" G_GSIZE_FORMAT ") : %d\n", stun_debug ("' (%" G_GSIZE_FORMAT ") : %d\n",
ufrag_len, memcmp (username, ufrag, ufrag_len)); ufrag_len, username_len >= ufrag_len ?
memcmp (username, ufrag, ufrag_len) : 0);
if (ufrag_len > 0 && username_len >= ufrag_len && if (ufrag_len > 0 && username_len >= ufrag_len &&
memcmp (username, ufrag, ufrag_len) == 0) { memcmp (username, ufrag, ufrag_len) == 0) {
gchar *pass = NULL; gchar *pass = NULL;
......
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