r13170: Remove some dependencies on -1 implying the size of pstring
authorJelmer Vernooij <jelmer@samba.org>
Thu, 26 Jan 2006 22:22:26 +0000 (22:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:51:31 +0000 (13:51 -0500)
source/auth/ntlmssp/ntlmssp_parse.c
source/torture/basic/scanner.c

index e8c08bf650dc25ca80b51051f2d21ebd8fa65768..4fbfede350d0e1e77c5e1fcffaf0774789142b0a 100644 (file)
@@ -238,9 +238,8 @@ BOOL msrpc_parse(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob,
                                        return False;
 
                                if (0 < len1) {
-                                       pull_string(p, blob->data + ptr, sizeof(p), 
-                                                   len1, 
-                                                   STR_UNICODE|STR_NOALIGN);
+                                       pull_ucs2(p, blob->data + ptr, sizeof(p), 
+                                                   len1, STR_NOALIGN);
                                        (*ps) = talloc_strdup(mem_ctx, p);
                                        if (!(*ps)) {
                                                return False;
@@ -269,9 +268,8 @@ BOOL msrpc_parse(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob,
                                        return False;   
 
                                if (0 < len1) {
-                                       pull_string(p, blob->data + ptr, sizeof(p), 
-                                                   len1, 
-                                                   STR_ASCII|STR_NOALIGN);
+                                       pull_ascii(p, blob->data + ptr, sizeof(p), 
+                                                   len1, STR_NOALIGN);
                                        (*ps) = talloc_strdup(mem_ctx, p);
                                        if (!(*ps)) {
                                                return False;
index 6e79745e890a6b5899acafcbe5788eeefe2a6079..92de78e7afc536a06d8f8920225181dfbf9aeda1 100644 (file)
@@ -448,7 +448,7 @@ static BOOL scan_nttrans(struct smbcli_state *cli, int op, int level,
        SSVAL(param, 0, level);
        SSVAL(param, 2, 0);
        SSVAL(param, 4, 0);
-       param_len += push_string(&param[6], fname, -1, STR_TERMINATE | STR_UNICODE);
+       param_len += push_string(&param[6], fname, sizeof(pstring), STR_TERMINATE | STR_UNICODE);
 
        status = try_nttrans_len(cli, "fname", op, level, param, data, param_len, &data_len, 
                                &rparam_len, &rdata_len);
@@ -459,7 +459,7 @@ static BOOL scan_nttrans(struct smbcli_state *cli, int op, int level,
        SSVAL(param, 0, level);
        SSVAL(param, 2, 0);
        SSVAL(param, 4, 0);
-       param_len += push_string(&param[6], "\\newfile.dat", -1, STR_TERMINATE | STR_UNICODE);
+       param_len += push_string(&param[6], "\\newfile.dat", sizeof(pstring), STR_TERMINATE | STR_UNICODE);
 
        status = try_nttrans_len(cli, "newfile", op, level, param, data, param_len, &data_len, 
                                &rparam_len, &rdata_len);
@@ -471,7 +471,7 @@ static BOOL scan_nttrans(struct smbcli_state *cli, int op, int level,
        smbcli_mkdir(cli->tree, "\\testdir");
        param_len = 2;
        SSVAL(param, 0, level);
-       param_len += push_string(&param[2], "\\testdir", -1, STR_TERMINATE | STR_UNICODE);
+       param_len += push_string(&param[2], "\\testdir", sizeof(pstring), STR_TERMINATE | STR_UNICODE);
 
        status = try_nttrans_len(cli, "dfs", op, level, param, data, param_len, &data_len, 
                                &rparam_len, &rdata_len);