From 12705920452bc2106be03e582bb9f6502f61944f Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 31 Jul 2014 14:38:55 +0530 Subject: token validation: Fix udp client fetching when not using token validation --- src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index cbcff37..6ef0d37 100644 --- a/src/main.c +++ b/src/main.c @@ -112,7 +112,7 @@ stp_validate_fetch_token_from_query (GHashTable *tokens, token->stream_type = stp_get_stream_type_from_string (type); perms_token = g_hash_table_lookup (tokens, sessionid); - if (stp_inet_addrmask && + if (stp_inet_addrmask && perms_token && perms_token->stream_type != token->stream_type) { *http_status_code = SOUP_STATUS_FORBIDDEN; goto err; @@ -130,7 +130,8 @@ stp_validate_fetch_token_from_query (GHashTable *tokens, goto err; } - if (!stp_clients_is_subset (perms_token->udp_clients, + if (perms_token && + !stp_clients_is_subset (perms_token->udp_clients, token->udp_clients)) { *http_status_code = SOUP_STATUS_FORBIDDEN; goto err; -- cgit v0.11.2-2-gd1dd