summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/nsstest.c8
-rw-r--r--source3/torture/scanner.c15
-rw-r--r--source3/torture/torture.c12
3 files changed, 21 insertions, 14 deletions
diff --git a/source3/torture/nsstest.c b/source3/torture/nsstest.c
index 2e0892e020..ca662262f8 100644
--- a/source3/torture/nsstest.c
+++ b/source3/torture/nsstest.c
@@ -28,11 +28,13 @@ static int total_errors;
static void *find_fn(const char *name)
{
- pstring s;
+ char *s;
static void *h;
void *res;
- pstr_sprintf(s, "_nss_%s_%s", nss_name, name);
+ if (asprintf(&s, "_nss_%s_%s", nss_name, name) < 0) {
+ exit(1);
+ }
if (!h) {
h = sys_dlopen(so_path, RTLD_LAZY);
@@ -45,8 +47,10 @@ static void *find_fn(const char *name)
if (!res) {
printf("Can't find function %s\n", s);
total_errors++;
+ SAFE_FREE(s);
return NULL;
}
+ SAFE_FREE(s);
return res;
}
diff --git a/source3/torture/scanner.c b/source3/torture/scanner.c
index 4f52a5812c..21b32dcf23 100644
--- a/source3/torture/scanner.c
+++ b/source3/torture/scanner.c
@@ -23,6 +23,9 @@
#define OP_MIN 0
#define OP_MAX 20
+#define DATA_SIZE 1024
+#define PARAM_SIZE 1024
+
/****************************************************************************
look for a partial hit
****************************************************************************/
@@ -84,14 +87,14 @@ static NTSTATUS try_trans2_len(struct cli_state *cli,
NTSTATUS ret=NT_STATUS_OK;
ret = try_trans2(cli, op, param, data, param_len,
- sizeof(pstring), rparam_len, rdata_len);
+ DATA_SIZE, rparam_len, rdata_len);
#if VERBOSE
printf("op=%d level=%d ret=%s\n", op, level, nt_errstr(ret));
#endif
if (!NT_STATUS_IS_OK(ret)) return ret;
*data_len = 0;
- while (*data_len < sizeof(pstring)) {
+ while (*data_len < DATA_SIZE) {
ret = try_trans2(cli, op, param, data, param_len,
*data_len, rparam_len, rdata_len);
if (NT_STATUS_IS_OK(ret)) break;
@@ -115,7 +118,7 @@ static bool scan_trans2(struct cli_state *cli, int op, int level,
int data_len = 0;
int param_len = 0;
unsigned int rparam_len, rdata_len;
- pstring param, data;
+ char param[PARAM_SIZE], data[DATA_SIZE];
NTSTATUS status;
memset(data, 0, sizeof(data));
@@ -286,14 +289,14 @@ static NTSTATUS try_nttrans_len(struct cli_state *cli,
NTSTATUS ret=NT_STATUS_OK;
ret = try_nttrans(cli, op, param, data, param_len,
- sizeof(pstring), rparam_len, rdata_len);
+ DATA_SIZE, rparam_len, rdata_len);
#if VERBOSE
printf("op=%d level=%d ret=%s\n", op, level, nt_errstr(ret));
#endif
if (!NT_STATUS_IS_OK(ret)) return ret;
*data_len = 0;
- while (*data_len < sizeof(pstring)) {
+ while (*data_len < DATA_SIZE) {
ret = try_nttrans(cli, op, param, data, param_len,
*data_len, rparam_len, rdata_len);
if (NT_STATUS_IS_OK(ret)) break;
@@ -317,7 +320,7 @@ static bool scan_nttrans(struct cli_state *cli, int op, int level,
int data_len = 0;
int param_len = 0;
unsigned int rparam_len, rdata_len;
- pstring param, data;
+ char param[PARAM_SIZE], data[DATA_SIZE];
NTSTATUS status;
memset(data, 0, sizeof(data));
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 90221f850e..1aea6145b8 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -810,7 +810,7 @@ static bool run_netbench(int client)
{
struct cli_state *cli;
int i;
- pstring line;
+ char line[1024];
char cname[20];
FILE *f;
const char *params[20];
@@ -841,7 +841,7 @@ static bool run_netbench(int client)
/* printf("[%d] %s\n", line_count, line); */
all_string_sub(line,"client1", cname, sizeof(line));
-
+
/* parse the command parameters */
params[0] = strtok(line," ");
i = 0;
@@ -2041,7 +2041,7 @@ static bool run_fdpasstest(int dummy)
struct cli_state *cli1, *cli2;
const char *fname = "\\fdpass.tst";
int fnum1;
- pstring buf;
+ char buf[1024];
if (!torture_open_connection(&cli1, 0) || !torture_open_connection(&cli2, 1)) {
return False;
@@ -2095,7 +2095,7 @@ static bool run_fdsesstest(int dummy)
const char *fname1 = "\\fdsess1.tst";
int fnum1;
int fnum2;
- pstring buf;
+ char buf[1024];
bool ret = True;
if (!torture_open_connection(&cli, 0))
@@ -2317,7 +2317,7 @@ static bool run_randomipc(int dummy)
char *rparam = NULL;
char *rdata = NULL;
unsigned int rdrcnt,rprcnt;
- pstring param;
+ char param[1024];
int api, param_len, i;
struct cli_state *cli;
bool correct = True;
@@ -2480,7 +2480,7 @@ static bool run_trans2test(int dummy)
const char *fname = "\\trans2.tst";
const char *dname = "\\trans2";
const char *fname2 = "\\trans2\\trans2.tst";
- pstring pname;
+ char pname[1024];
bool correct = True;
printf("starting trans2 test\n");