3290 blob_len));
3291 }
3292
3293 cFYI(1,
3294 ("NTLMSSP response to Authenticate "));
3295
3296 if (smb_buffer->Flags2 & SMBFLG2_UNICODE) {
3297 if ((long) (bcc_ptr) % 2) {
3298 remaining_words =
3299 (BCC(smb_buffer_response)
3300 - 1) / 2;
3301 bcc_ptr++;
3302 } else {
3303 remaining_words = BCC(smb_buffer_response) / 2;
3304 }
3305 len = UniStrnlen((wchar_t *) bcc_ptr,
3306 remaining_words - 1);
3307
3308
3309
3310 if (ses->serverOS)
3311 kfree(ses->serverOS);
3312 ses->serverOS =
3313 kzalloc(2 * (len + 1), GFP_KERNEL);
3314 cifs_strfromUCS_le(ses->serverOS,
3315 (__le16 *)
3316 bcc_ptr, len,
3317 nls_codepage);
3318 bcc_ptr += 2 * (len + 1);
3319 remaining_words -= len + 1;
3320 ses->serverOS[2 * len] = 0;
3321 ses->serverOS[1 + (2 * len)] = 0;
3322 if (remaining_words > 0) {
3323 len = UniStrnlen((wchar_t *)
3324 bcc_ptr,
3325 remaining_words
3326 - 1);
3327 kfree(ses->serverNOS);
3328 ses->serverNOS =
3329 kzalloc(2 * (len + 1),
3330 GFP_KERNEL);