mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Removed CR/LF from redirection to avoid XSS
SVN revision: 2218
This commit is contained in:
parent
6af8e2c68c
commit
e2d1784826
12
src/elogd.c
12
src/elogd.c
@ -6750,11 +6750,19 @@ void compose_base_url(LOGBOOK * lbs, char *base_url, int size, BOOL email_notify
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
void set_location(LOGBOOK * lbs, char *rel_path)
|
||||
void set_location(LOGBOOK * lbs, char *rp)
|
||||
{
|
||||
char str[NAME_LENGTH], group[NAME_LENGTH], list[NAME_LENGTH], *p;
|
||||
char str[NAME_LENGTH], group[NAME_LENGTH], list[NAME_LENGTH], *p,
|
||||
rel_path[NAME_LENGTH];
|
||||
int i;
|
||||
|
||||
/* remove any CR/LF from path */
|
||||
strlcpy(rel_path, rp, sizeof(rel_path));
|
||||
if (strchr(rel_path, '\r'))
|
||||
*strchr(rel_path, '\r') = 0;
|
||||
if (strchr(rel_path, '\n'))
|
||||
*strchr(rel_path, '\n') = 0;
|
||||
|
||||
if (getcfg(lbs->name, "Relative redirect", str, sizeof(str)) && atoi(str) == 1) {
|
||||
|
||||
if (rel_path[0])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user