try to handle end of packet for not null terminated domain strings
authorAndrew Tridgell <tridge@samba.org>
Fri, 21 Dec 2001 11:58:30 +0000 (11:58 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 21 Dec 2001 11:58:30 +0000 (11:58 +0000)
(This used to be commit 1da988456dbd885820093ae43c74e0ac66f72802)

source3/libsmb/cliconnect.c

index fc50e8e02fe07445d70e7a7bf5bb09afbdb601b2..d636e7e839e4e9549f0850121bef7469d39050c1 100644 (file)
@@ -372,7 +372,9 @@ static DATA_BLOB cli_session_setup_blob(struct cli_state *cli, DATA_BLOB blob)
        p += blob2.length;
        p += clistr_pull(cli, cli->server_os, p, sizeof(fstring), -1, STR_TERMINATE);
        p += clistr_pull(cli, cli->server_type, p, sizeof(fstring), -1, STR_TERMINATE);
-       p += clistr_pull(cli, cli->server_domain, p, sizeof(fstring), -1, STR_TERMINATE);
+       p += clistr_pull(cli, cli->server_domain, p, sizeof(fstring), 
+                        smb_buflen(cli->inbuf) - PTR_DIFF(p, smb_buf(cli->inbuf)),
+                        0);
 
        return blob2;
 }