commit 7bc63c3b6b1ca5ec60e1160e107121d568de5d29
parent 9a8fca09c6e8370d53a6cd7e7000e3aa42b84b3f
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 30 Jun 2026 16:50:16 +0200
add NULL-guards
Diffstat:
2 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/src/auditordb/delete_generic.c b/src/auditordb/delete_generic.c
@@ -31,12 +31,12 @@ struct Preparations
};
+
enum GNUNET_DB_QueryStatus
-TALER_AUDITORDB_delete_generic (struct TALER_AUDITORDB_PostgresContext *pg,
- enum TALER_AUDITORDB_DeletableSuppressableTables
- table
- ,
- uint64_t row_id)
+TALER_AUDITORDB_delete_generic (
+ struct TALER_AUDITORDB_PostgresContext *pg,
+ enum TALER_AUDITORDB_DeletableSuppressableTables table,
+ uint64_t row_id)
{
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&row_id),
@@ -46,11 +46,13 @@ TALER_AUDITORDB_delete_generic (struct TALER_AUDITORDB_PostgresContext *pg,
TALER_AUDITORDB_DELETABLESUPPRESSABLE_TABLES_MAX];
struct Preparations *prep = &preps[table];
- const char *table_name = TALER_AUDITORDB_get_deletable_suppressable_table_name
- (
- table);
+ const char *table_name
+ = TALER_AUDITORDB_get_deletable_suppressable_table_name (
+ table);
char statement_name[256];
+ if (NULL == table_name)
+ return GNUNET_DB_STATUS_HARD_ERROR;
GNUNET_snprintf (statement_name,
sizeof (statement_name),
"delete_%s",
diff --git a/src/auditordb/update_generic_suppressed.c b/src/auditordb/update_generic_suppressed.c
@@ -33,13 +33,11 @@ struct Preparations
enum GNUNET_DB_QueryStatus
-TALER_AUDITORDB_update_generic_suppressed (struct
- TALER_AUDITORDB_PostgresContext *pg,
- enum
- TALER_AUDITORDB_DeletableSuppressableTables
- table,
- uint64_t row_id,
- bool suppressed)
+TALER_AUDITORDB_update_generic_suppressed (
+ struct TALER_AUDITORDB_PostgresContext *pg,
+ enum TALER_AUDITORDB_DeletableSuppressableTables table,
+ uint64_t row_id,
+ bool suppressed)
{
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&row_id),
@@ -50,11 +48,13 @@ TALER_AUDITORDB_update_generic_suppressed (struct
TALER_AUDITORDB_DELETABLESUPPRESSABLE_TABLES_MAX];
struct Preparations *prep = &preps[table];
- const char *table_name = TALER_AUDITORDB_get_deletable_suppressable_table_name
- (
- table);
+ const char *table_name
+ = TALER_AUDITORDB_get_deletable_suppressable_table_name (
+ table);
char statement_name[256];
+ if (NULL == table_name)
+ return GNUNET_DB_STATUS_HARD_ERROR;
GNUNET_snprintf (statement_name,
sizeof (statement_name),
"update_%s",