diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2012-08-13 20:17:20 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-08-14 08:37:49 +1000 |
commit | f11a1a4a0796c8e77eee721f1ed1406b01e2b007 (patch) | |
tree | e4877ddfae6d49ad83f16522555b0bdda000da38 /source4/kdc | |
parent | a57c5eb848698a4231f851744949c6a44e92784a (diff) | |
download | samba-f11a1a4a0796c8e77eee721f1ed1406b01e2b007.tar.gz samba-f11a1a4a0796c8e77eee721f1ed1406b01e2b007.tar.bz2 samba-f11a1a4a0796c8e77eee721f1ed1406b01e2b007.zip |
s4:kdc/wdc-samba4.c - fix user logins on specific workstations
The decrement operation has been missing.
Problem found by Mohammad Ebrahim Abravi <lamp.mia@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/kdc')
-rw-r--r-- | source4/kdc/wdc-samba4.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/kdc/wdc-samba4.c b/source4/kdc/wdc-samba4.c index 70e849ccb7..2f4945c312 100644 --- a/source4/kdc/wdc-samba4.c +++ b/source4/kdc/wdc-samba4.c @@ -187,14 +187,15 @@ static char *get_netbios_name(TALLOC_CTX *mem_ctx, HostAddresses *addrs) } } - if (nb_name == NULL) { + if ((nb_name == NULL) || (nb_name[0] == '\0')) { return NULL; } /* Strip space padding */ - i = strlen(nb_name) - 1; - while (i > 0 && nb_name[i] == ' ') { - nb_name[i] = '\0'; + for (len = strlen(nb_name) - 1; + (len > 0) && (nb_name[len] == ' '); + --len) { + nb_name[len] = '\0'; } return nb_name; |