Do not permit periods in session names (colons are already banned). From

J Raynor.
pull/1/head
nicm 2014-01-22 14:00:08 +00:00
parent df680d7257
commit 9ee93b3ea3
1 changed files with 2 additions and 2 deletions

View File

@ -175,11 +175,11 @@ session_destroy(struct session *s)
RB_INSERT(sessions, &dead_sessions, s); RB_INSERT(sessions, &dead_sessions, s);
} }
/* Check a session name is valid: not empty and no colons. */ /* Check a session name is valid: not empty and no colons or periods. */
int int
session_check_name(const char *name) session_check_name(const char *name)
{ {
return (*name != '\0' && strchr(name, ':') == NULL); return (*name != '\0' && name[strcspn(name, ":.")] == '\0');
} }
/* Update session active time. */ /* Update session active time. */