Commit 1d4c0f9d authored by Niels Möller's avatar Niels Möller

* testsuite/yarrow-test.c (open_file): Likewise.

* testsuite/rsa-encrypt-test.c (test_main): Likewise.
* testsuite/bignum-test.c (test_bignum): Likewise.

Rev: src/nettle/testsuite/bignum-test.c:1.4
Rev: src/nettle/testsuite/rsa-encrypt-test.c:1.3
Rev: src/nettle/testsuite/yarrow-test.c:1.14
parent cf73548b
......@@ -23,7 +23,7 @@ test_bignum(const char *hex, unsigned length, const uint8_t *base256)
if (mpz_cmp(a, b))
FAIL();
buf = alloca(length + 1);
buf = xalloc(length + 1);
memset(buf, 17, length + 1);
nettle_mpz_get_str_256(length, buf, a);
......@@ -34,6 +34,7 @@ test_bignum(const char *hex, unsigned length, const uint8_t *base256)
FAIL();
mpz_clear(a); mpz_clear(b);
free(buf);
}
static void
......
......@@ -44,7 +44,7 @@ test_main(void)
mpz_out_str(stderr, 10, gibberish);
}
decrypted = alloca(msg_length + 1);
decrypted = xalloc(msg_length + 1);
decrypted_length = msg_length - 1;
ASSERT(!rsa_decrypt(&key, &decrypted_length, decrypted, gibberish));
......@@ -62,7 +62,7 @@ test_main(void)
rsa_private_key_clear(&key);
rsa_public_key_clear(&pub);
mpz_clear(gibberish);
free(decrypted);
SUCCESS();
#else /* !WITH_PUBLIC_KEY */
......
......@@ -45,7 +45,8 @@ open_file(const char *name)
const char *srcdir = getenv("srcdir");
if (srcdir && srcdir[0])
{
char *buf = alloca(strlen(name) + strlen(srcdir) + 10);
/* Leaks this name, but that doesn't matter. */
char *buf = xalloc(strlen(name) + strlen(srcdir) + 10);
sprintf(buf, "%s/%s", srcdir, name);
name = buf;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment