client->conn->refcount--;
}
master_login_conn_unref(&client->conn);
+ i_free(client->session_id);
i_free(client);
}
break;
}
}
- if (session_len >= sizeof(client->session_id)) {
- i_error("login client: Session ID too long");
- session_len = 0;
- }
/* @UNSAFE: we have a request. do userdb lookup for it. */
req.data_size -= i;
client->conn = conn;
client->fd = client_fd;
client->auth_req = req;
- memcpy(client->session_id, data, session_len);
+ client->session_id = i_strndup(data, session_len);
memcpy(client->data, data+i, req.data_size);
conn->refcount++;
#include "master-auth.h"
#define MASTER_POSTLOGIN_TIMEOUT_DEFAULT 60
-/* base64(<IPv6><port><48bit timestamp>) + NUL */
-#define LOGIN_MAX_SESSION_ID_LEN 33
struct master_login_client {
struct master_login_connection *conn;
int fd;
struct master_auth_request auth_req;
- char session_id[LOGIN_MAX_SESSION_ID_LEN];
+ char *session_id;
unsigned char data[FLEXIBLE_ARRAY_MEMBER];
};