Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/vmod_querymodifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ static char *rebuild_query_string(VRT_CTX, const char *uri_base,
}

VSB_cat(vsb, uri_base);
if (VSB_error(vsb)) {
VRT_fail(ctx, "VSB overflow while appending base URI");
VSB_destroy(&vsb);
return NULL;
}

for (size_t i = 0; i < param_count; i++) {
query_param_t *current = &params[i];
Expand All @@ -181,6 +186,13 @@ static char *rebuild_query_string(VRT_CTX, const char *uri_base,
// Parameter with no value
VSB_printf(vsb, "%c%s", sep, current->name);
}

if (VSB_error(vsb)) {
VRT_fail(ctx, "VSB overflow while building query string");
VSB_destroy(&vsb);
return NULL;
}

sep = '&';
}
}
Expand Down