summaryrefslogtreecommitdiff
path: root/source4/torture/basic
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/basic')
-rw-r--r--source4/torture/basic/utable.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c
index eaa3f39e9c..d5b808244d 100644
--- a/source4/torture/basic/utable.c
+++ b/source4/torture/basic/utable.c
@@ -50,9 +50,15 @@ 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(CH_UTF16, CH_UNIX,
+ len = 0;
+ if (!convert_string(CH_UTF16, CH_UNIX,
c2, 2,
- p, sizeof(fname)-strlen(fname));
+ p, sizeof(fname)-strlen(fname), &len)) {
+ torture_comment(tctx, "convert_string failed [%s]\n",
+ fname);
+ continue;
+ }
+
p[len] = 0;
strncat(fname,"_a_long_extension",sizeof(fname)-1);
@@ -103,17 +109,17 @@ static char *form_name(int c)
static char fname[256];
uint8_t c2[4];
char *p;
- size_t len;
+ size_t len = 0;
strncpy(fname, "\\utable\\", sizeof(fname)-1);
p = fname+strlen(fname);
SSVAL(c2, 0, c);
- len = convert_string(CH_UTF16, CH_UNIX,
+ if (!convert_string(CH_UTF16, CH_UNIX,
c2, 2,
- p, sizeof(fname)-strlen(fname));
- if (len == -1)
+ p, sizeof(fname)-strlen(fname), &len)) {
return NULL;
+ }
p[len] = 0;
return fname;
}