summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/basic/charset.c5
-rw-r--r--source4/torture/basic/utable.c13
-rw-r--r--source4/torture/rpc/samlogon.c4
-rw-r--r--source4/torture/rpc/spoolss_win.c2
4 files changed, 12 insertions, 12 deletions
diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c
index 33ab2c9768..5ac299dbbe 100644
--- a/source4/torture/basic/charset.c
+++ b/source4/torture/basic/charset.c
@@ -42,7 +42,7 @@ static NTSTATUS unicode_open(struct torture_context *tctx,
{
union smb_open io;
char *fname, *fname2=NULL, *ucs_name;
- int i;
+ size_t i;
NTSTATUS status;
ucs_name = talloc_size(mem_ctx, (1+u_name_len)*2);
@@ -56,8 +56,7 @@ static NTSTATUS unicode_open(struct torture_context *tctx,
}
SSVAL(ucs_name, i*2, 0);
- i = convert_string_talloc_convenience(ucs_name, lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, false);
- if (i == -1) {
+ if (!convert_string_talloc_convenience(ucs_name, lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, &i, false)) {
torture_comment(tctx, "Failed to convert UCS2 Name into unix - convert_string_talloc() failure\n");
talloc_free(ucs_name);
return NT_STATUS_NO_MEMORY;
diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c
index ef0e4d44ed..ca6c2fd576 100644
--- a/source4/torture/basic/utable.c
+++ b/source4/torture/basic/utable.c
@@ -32,7 +32,8 @@ bool torture_utable(struct torture_context *tctx,
const char *alt_name;
int fnum;
uint8_t c2[4];
- int c, len, fd;
+ int c, fd;
+ size_t len;
int chars_allowed=0, alt_allowed=0;
uint8_t valid[0x10000];
@@ -49,9 +50,9 @@ bool torture_utable(struct torture_context *tctx,
SSVAL(c2, 0, c);
strncpy(fname, "\\utable\\x", sizeof(fname)-1);
p = fname+strlen(fname);
- len = convert_string_convenience(lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX,
+ convert_string_convenience(lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX,
c2, 2,
- p, sizeof(fname)-strlen(fname), false);
+ p, sizeof(fname)-strlen(fname), &len, false);
p[len] = 0;
strncat(fname,"_a_long_extension",sizeof(fname)-1);
@@ -102,15 +103,15 @@ static char *form_name(struct smb_iconv_convenience *iconv_convenience, int c)
static char fname[256];
uint8_t c2[4];
char *p;
- int len;
+ size_t len;
strncpy(fname, "\\utable\\", sizeof(fname)-1);
p = fname+strlen(fname);
SSVAL(c2, 0, c);
- len = convert_string_convenience(iconv_convenience, CH_UTF16, CH_UNIX,
+ convert_string_convenience(iconv_convenience, CH_UTF16, CH_UNIX,
c2, 2,
- p, sizeof(fname)-strlen(fname), false);
+ p, sizeof(fname)-strlen(fname), &len, false);
p[len] = 0;
return fname;
}
diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c
index 7e1744ffab..0f0b8dc84d 100644
--- a/source4/torture/rpc/samlogon.c
+++ b/source4/torture/rpc/samlogon.c
@@ -1171,11 +1171,11 @@ static bool test_plaintext(struct samlogon_state *samlogon_state, enum ntlm_brea
password = strupper_talloc(samlogon_state->mem_ctx, samlogon_state->password);
- if ((convert_string_talloc_convenience(samlogon_state->mem_ctx,
+ if (!convert_string_talloc_convenience(samlogon_state->mem_ctx,
samlogon_state->iconv_convenience,
CH_UNIX, CH_DOS,
password, strlen(password)+1,
- (void**)&dospw, false)) == -1) {
+ (void**)&dospw, NULL, false)) {
DEBUG(0, ("convert_string_talloc failed!\n"));
exit(1);
}
diff --git a/source4/torture/rpc/spoolss_win.c b/source4/torture/rpc/spoolss_win.c
index b09c62479c..08fadafe2c 100644
--- a/source4/torture/rpc/spoolss_win.c
+++ b/source4/torture/rpc/spoolss_win.c
@@ -383,7 +383,7 @@ static bool test_EnumPrinterKey(struct torture_context *tctx,
convert_string_talloc_convenience(ctx, lp_iconv_convenience(tctx->lp_ctx), CH_UTF16,
CH_UNIX, epk.out.key_buffer, *epk.out.needed,
- (void**)&ctx->printer_keys, false);
+ (void**)&ctx->printer_keys, NULL, false);
return true;
}