mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-12 12:41:16 +00:00
Fix mismatched free and strcpy overlap
This commit is contained in:
parent
e0d6c1ee98
commit
94040cc0d9
3 changed files with 11 additions and 7 deletions
|
|
@ -630,7 +630,11 @@ static void authorize(struct mg_connection *conn,
|
|||
/* Referer url must begin with '/' */
|
||||
if((referer[0] != '/') || (strcmp(referer, AUTHORIZE_URL) == 0)) {
|
||||
char *r = strchr(referer, '/');
|
||||
strcpy(referer, r ? r : "/");
|
||||
|
||||
if(r)
|
||||
memmove(referer, r, strlen(r)+1 /* with null terminator */);
|
||||
else
|
||||
strcpy(referer, "/");
|
||||
}
|
||||
|
||||
/* Send session cookie and set user for the new session */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue