Set max character buffer len to 512 per MS specification
The MS specs determine that the character buffer lenngths for usernames, domains, passwords, alternate shells, etc can be up to 512 characters including the mandatory null terminator.
This commit is contained in:
committed by
Bolke de Bruin
parent
f3e42fc209
commit
5cd36c511c
+5
-5
@@ -735,7 +735,7 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
|
||||
}
|
||||
in_uint16_le(s, len_domain);
|
||||
|
||||
if (len_domain > 511)
|
||||
if (len_domain >= INFO_CLIENT_MAX_CB_LEN)
|
||||
{
|
||||
DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_domain > 511"));
|
||||
return 1;
|
||||
@@ -757,7 +757,7 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
|
||||
self->rdp_layer->client_info.rdp_autologin = 0;
|
||||
}
|
||||
|
||||
if (len_user > 511)
|
||||
if (len_user >= INFO_CLIENT_MAX_CB_LEN)
|
||||
{
|
||||
DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_user > 511"));
|
||||
return 1;
|
||||
@@ -769,7 +769,7 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
|
||||
}
|
||||
in_uint16_le(s, len_password);
|
||||
|
||||
if (len_password > 511)
|
||||
if (len_password >= INFO_CLIENT_MAX_CB_LEN)
|
||||
{
|
||||
DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_password > 511"));
|
||||
return 1;
|
||||
@@ -781,7 +781,7 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
|
||||
}
|
||||
in_uint16_le(s, len_program);
|
||||
|
||||
if (len_program > 511)
|
||||
if (len_program >= INFO_CLIENT_MAX_CB_LEN)
|
||||
{
|
||||
DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_program > 511"));
|
||||
return 1;
|
||||
@@ -793,7 +793,7 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
|
||||
}
|
||||
in_uint16_le(s, len_directory);
|
||||
|
||||
if (len_directory > 511)
|
||||
if (len_directory >= INFO_CLIENT_MAX_CB_LEN)
|
||||
{
|
||||
DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_directory > 511"));
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user