summaryrefslogtreecommitdiff
path: root/res/res_sorcery_realtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_sorcery_realtime.c')
-rw-r--r--res/res_sorcery_realtime.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/res/res_sorcery_realtime.c b/res/res_sorcery_realtime.c
index 8807c0196..1a30e0c59 100644
--- a/res/res_sorcery_realtime.c
+++ b/res/res_sorcery_realtime.c
@@ -218,16 +218,12 @@ static void sorcery_realtime_retrieve_multiple(const struct ast_sorcery *sorcery
static void sorcery_realtime_retrieve_regex(const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const char *regex)
{
- char field[strlen(UUID_FIELD) + 6], value[strlen(regex) + 2];
+ char field[strlen(UUID_FIELD) + 6], value[strlen(regex) + 3];
RAII_VAR(struct ast_variable *, fields, NULL, ast_variables_destroy);
/* The realtime API provides no direct ability to do regex so for now we support a limited subset using pattern matching */
- if (regex[0] != '^') {
- return;
- }
-
snprintf(field, sizeof(field), "%s LIKE", UUID_FIELD);
- snprintf(value, sizeof(value), "%s%%", regex + 1);
+ snprintf(value, sizeof(value), "%%%s%%", regex);
if (!(fields = ast_variable_new(field, value, ""))) {
return;