mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-05 17:30:27 +00:00
Update ProgramRedirect to check location validity
This commit is contained in:
parent
b2a6752cfe
commit
f12a063a40
1 changed files with 6 additions and 0 deletions
|
@ -750,6 +750,12 @@ static void ProgramRedirect(int code, const char *sp, size_t sn, const char *dp,
|
|||
fprintf(stderr, "error: unsupported redirect code %d\n", code);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!(FreeLater(EncodeHttpHeaderValue(dp, dn, 0)))) {
|
||||
fprintf(stderr, "error: invalid location %s\n", dp);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
r.code = code;
|
||||
r.path.s = sp;
|
||||
r.path.n = sn;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue