Fix truncated username

This commit is contained in:
emanuele-f 2018-08-21 19:30:09 +02:00
parent f2a438c33a
commit c212844616

View file

@ -381,7 +381,7 @@ static int getAuthorizedUser(const struct mg_connection *conn,
snprintf(key, sizeof(key), "sessions.%s", session_id);
username[0] = '\0';
if((ntop->getRedis()->get(key, username, sizeof(username), true) < 0) || (!username[0])) {
if((ntop->getRedis()->get(key, username, username_len, true) < 0) || (!username[0])) {
ntop->getTrace()->traceEvent(TRACE_INFO, "[HTTP] Session %s is expired", session_id);
return(0);
}