diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-01-10 13:13:40 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2014-01-22 17:12:14 +0100 |
commit | b8fdeb8ca7ce362058bb86a4e58b34fb6340867e (patch) | |
tree | d88e35f48d97b0de9453d71f01036fd121100f89 | |
parent | 387ed2e15df085274f72cebda341040a1e767a4b (diff) | |
download | samba-b8fdeb8ca7ce362058bb86a4e58b34fb6340867e.tar.gz |
libcli/auth: reject computer_name longer than 15 chars
This matches Windows, it seems they use a fixed size field to store
netlogon_creds_CredentialState.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | libcli/auth/schannel_state_tdb.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libcli/auth/schannel_state_tdb.c b/libcli/auth/schannel_state_tdb.c index 8c893ee08ee..6669b465b73 100644 --- a/libcli/auth/schannel_state_tdb.c +++ b/libcli/auth/schannel_state_tdb.c @@ -78,6 +78,14 @@ NTSTATUS schannel_store_session_key_tdb(struct db_context *db_sc, char *name_upper; NTSTATUS status; + if (strlen(creds->computer_name) > 15) { + /* + * We may want to check for a completely + * valid netbios name. + */ + return STATUS_BUFFER_OVERFLOW; + } + name_upper = strupper_talloc(mem_ctx, creds->computer_name); if (!name_upper) { return NT_STATUS_NO_MEMORY; |