NLA: Fixed length check.
authorArmin Novak <armin.novak@thincast.com>
Wed, 1 Jul 2015 14:05:11 +0000 (16:05 +0200)
committerArmin Novak <armin.novak@thincast.com>
Wed, 1 Jul 2015 14:05:11 +0000 (16:05 +0200)
libfreerdp/core/nla.c

index c2c742d..88192b9 100644 (file)
@@ -929,9 +929,12 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s)
        nla->identity->Password = NULL;
        nla->identity->PasswordLength = (UINT32) 0;
 
+       if (!ber_read_sequence_tag(s, &length))
+               return FALSE;
+
        /* The sequence is empty, return early,
         * TSPasswordCreds (SEQUENCE) is optional. */
-       if (!ber_read_sequence_tag(s, &length))
+       if (length == 0)
                return TRUE;
 
        /* [0] domainName (OCTET STRING) */