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

Check that the buffers are our fake data before counting them (so that refused...

Check that the buffers are our fake data before counting them (so that refused stun packages dont trigger it)
parent 790b09d3
...@@ -86,6 +86,14 @@ static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id, ...@@ -86,6 +86,14 @@ static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id,
/* XXX: dear compiler, these are for you: */ /* XXX: dear compiler, these are for you: */
(void)agent; (void)stream_id; (void)component_id; (void)buf; (void)agent; (void)stream_id; (void)component_id; (void)buf;
/*
* Lets ignore stun packets that got through
*/
if (len != 16)
return;
if (strncmp ("1234567812345678", buf, 16))
return;
if ((intptr_t)user_data == 2) { if ((intptr_t)user_data == 2) {
global_ragent_read += len; global_ragent_read += len;
......
...@@ -84,6 +84,14 @@ static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id, ...@@ -84,6 +84,14 @@ static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id,
/* XXX: dear compiler, these are for you: */ /* XXX: dear compiler, these are for you: */
(void)agent; (void)stream_id; (void)component_id; (void)buf; (void)agent; (void)stream_id; (void)component_id; (void)buf;
/*
* Lets ignore stun packets that got through
*/
if (len < 8)
return;
if (strncmp ("12345678", buf, 8))
return;
if ((intptr_t)user_data == 2) { if ((intptr_t)user_data == 2) {
global_ragent_read = len; global_ragent_read = len;
g_main_loop_quit (global_mainloop); g_main_loop_quit (global_mainloop);
......
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