return; /* Should not happen - frame already validated */
wpa_hexdump_ascii(MSG_DEBUG, "EAP-Identity: Peer identity", pos, len);
- buf = os_malloc(len * 3 + 1);
+ buf = os_malloc(len * 4 + 1);
if (buf) {
- printf_encode(buf, len * 3 + 1, pos, len);
+ printf_encode(buf, len * 4 + 1, pos, len);
eap_log_msg(sm, "EAP-Response/Identity '%s'", buf);
os_free(buf);
}
wpa_printf(MSG_MSGDUMP, "EAP-MSCHAPV2: Flags 0x%x", flags);
wpa_hexdump_ascii(MSG_MSGDUMP, "EAP-MSCHAPV2: Name", name, name_len);
- buf = os_malloc(name_len * 3 + 1);
+ buf = os_malloc(name_len * 4 + 1);
if (buf) {
- printf_encode(buf, name_len * 3 + 1, name, name_len);
+ printf_encode(buf, name_len * 4 + 1, name, name_len);
eap_log_msg(sm, "EAP-MSCHAPV2 Name '%s'", buf);
os_free(buf);
}
if (parse.user_name) {
char *nbuf;
- nbuf = os_malloc(parse.user_name_len * 3 + 1);
+ nbuf = os_malloc(parse.user_name_len * 4 + 1);
if (nbuf) {
- printf_encode(nbuf, parse.user_name_len * 3 + 1,
+ printf_encode(nbuf, parse.user_name_len * 4 + 1,
parse.user_name,
parse.user_name_len);
eap_log_msg(sm, "TTLS-User-Name '%s'", nbuf);
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) {