anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

commit 2d3a03545b50a1e848c0c9c99555eeb605d2e495
parent cb9d061522ad97e4c368d1de602278c1502ff16e
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 29 Jul 2026 13:08:46 +0200

cli: NULL-check the json_dumps result before printing it

Diffstat:
Msrc/cli/anastasis-cli-redux.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/cli/anastasis-cli-redux.c b/src/cli/anastasis-cli-redux.c @@ -114,6 +114,13 @@ persist_new_state (json_t *state, { char *state_str = json_dumps (state, JSON_COMPACT); + + if (NULL == state_str) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Could not serialize state to JSON\n"); + return; + } if (-1 >= fprintf (stdout, "%s",