summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-06-20 19:01:54 +0200
committerChristian Grothoff <christian@grothoff.org>2023-06-20 19:01:54 +0200
commit913c2ecc76742983ee9d21c257be907cbb537e65 (patch)
tree87e4804e6c7f6bb9c3795c18d0aaa986e7d93a4c /src/testing
parentb2c046a3f65f823ff6fbfef4f9c96e876aed56dc (diff)
downloadanastasis-913c2ecc76742983ee9d21c257be907cbb537e65.tar.gz
anastasis-913c2ecc76742983ee9d21c257be907cbb537e65.tar.bz2
anastasis-913c2ecc76742983ee9d21c257be907cbb537e65.zip
-fix recdoc use-after-free
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing_cmd_recover_secret.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/testing/testing_cmd_recover_secret.c b/src/testing/testing_cmd_recover_secret.c
index 35a8580..1f3e832 100644
--- a/src/testing/testing_cmd_recover_secret.c
+++ b/src/testing/testing_cmd_recover_secret.c
@@ -108,13 +108,19 @@ policy_lookup_cb (void *cls,
{
struct RecoverSecretState *rss = cls;
- rss->ri = (struct ANASTASIS_RecoveryInformation *) ri;
if (NULL == ri)
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (rss->is);
return;
}
+ if (0 == ri->cs_len)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (rss->is);
+ return;
+ }
+ rss->ri = (struct ANASTASIS_RecoveryInformation *) ri;
TALER_TESTING_interpreter_next (rss->is);
}
@@ -188,9 +194,9 @@ recover_secret_run (void *cls,
if (NULL != rss->download_reference)
{
- ref = TALER_TESTING_interpreter_lookup_command
- (is,
- rss->download_reference);
+ ref = TALER_TESTING_interpreter_lookup_command (
+ is,
+ rss->download_reference);
if (NULL == ref)
{
GNUNET_break (0);