argc = rad_expand_xlat(request, p, MAX_REDIS_ARGS, argv, false, sizeof(argv_buf), argv_buf);
if (argc <= 0) {
RPEDEBUG("Invalid command: %s", p);
+ arg_error:
fr_pool_connection_release(pool, request, conn);
return -1;
}
+ if (argc >= (MAX_REDIS_ARGS - 1)) {
+ RPEDEBUG("Too many parameters; increase MAX_REDIS_ARGS and recompile: %s", p);
+ goto arg_error;
+ }
RDEBUG2("Executing command: %s", argv[0]);
if (argc > 1) {
goto finish;
}
+ if (argc >= (MAX_REDIS_ARGS - 1)) {
+ RPEDEBUG("Too many parameters; increase MAX_REDIS_ARGS and recompile: %s", p);
+ ret = -1;
+ goto finish;
+ }
+
/*
* If we've got multiple arguments, the second one is usually the key.
* The Redis docs say commands should be analysed first to get key