aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-06-02 12:50:31 (GMT)
committerJouni Malinen <j@w1.fi>2014-06-02 14:36:51 (GMT)
commit95f6f6a49d44a2fc23e425482455cd170ee8255a (patch)
tree3cc9ef72475687f1bb7df21a5d42e068027c0d52 /src/radius
parentee54e4010e57c68422d1db8d7388dcf001d3db7d (diff)
downloadhostap-95f6f6a49d44a2fc23e425482455cd170ee8255a.zip
hostap-95f6f6a49d44a2fc23e425482455cd170ee8255a.tar.gz
hostap-95f6f6a49d44a2fc23e425482455cd170ee8255a.tar.bz2
RADIUS/EAP server: Use longer username buffer to avoid truncation
If the peer provides a username with large part of it being non-ASCII characters, the previously used buffers may not have been long enough to include the full string in debug logs and database search due to forced truncation of the string by printf_encode(). Avoid this by increasing the buffer sizes to fit in the maximum result. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/radius')
-rw-r--r--src/radius/radius_server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/radius/radius_server.c b/src/radius/radius_server.c
index 78c9961..c35ba55 100644
--- a/src/radius/radius_server.c
+++ b/src/radius/radius_server.c
@@ -639,12 +639,12 @@ radius_server_get_new_session(struct radius_server_data *data,
sess->accept_attr = tmp.accept_attr;
sess->macacl = tmp.macacl;
- sess->username = os_malloc(user_len * 2 + 1);
+ sess->username = os_malloc(user_len * 4 + 1);
if (sess->username == NULL) {
radius_server_session_free(data, sess);
return NULL;
}
- printf_encode(sess->username, user_len * 2 + 1, user, user_len);
+ printf_encode(sess->username, user_len * 4 + 1, user, user_len);
sess->nas_ip = os_strdup(from_addr);
if (sess->nas_ip == NULL) {