Skip to content

Commit

Permalink
Merge pull request #2358 from mcnewton/v3.0.x
Browse files Browse the repository at this point in the history
rlm_redis: don't send junk to redis when we hit the max number of args
  • Loading branch information
mcnewton committed Nov 21, 2018
2 parents 0e08a11 + 2ac0745 commit 6de42cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -105,6 +105,7 @@ FreeRADIUS 3.0.18 Tue 17 Apr 2018 14:00:00 EDT urgency=low
* The "expr" module now skips more whitespace.
* Remove internal FreeRADIUS-Response-Delay attributes
from attr_filter Access-Reject.
* Don't send junk to redis when maximum args reached.

FreeRADIUS 3.0.17 Tue 17 Apr 2018 14:00:00 EDT urgency=low
Feature improvements
Expand Down
6 changes: 6 additions & 0 deletions src/modules/rlm_redis/rlm_redis.c
Expand Up @@ -238,6 +238,12 @@ int rlm_redis_query(REDISSOCK **dissocket_p, REDIS_INST *inst,
if (argc <= 0)
return -1;

if (argc >= (MAX_REDIS_ARGS - 1)) {
RERROR("rlm_redis (%s): query has too many parameters; increase "
"MAX_REDIS_ARGS and recompile", inst->xlat_name);
return -1;
}

dissocket = *dissocket_p;

DEBUG2("rlm_redis (%s): executing the query: \"%s\"", inst->xlat_name, query);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/rlm_redis/rlm_redis.h
Expand Up @@ -55,7 +55,7 @@ typedef struct rlm_redis_t {
} rlm_redis_t;

#define MAX_QUERY_LEN 4096
#define MAX_REDIS_ARGS 16
#define MAX_REDIS_ARGS 32

int rlm_redis_query(REDISSOCK **dissocket_p, REDIS_INST *inst,
char const *query, REQUEST *request);
Expand Down

0 comments on commit 6de42cf

Please sign in to comment.