From a0fbee4ae56881bd1654d300e9c84db4f42aa1cd Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 5 Apr 2016 16:18:15 +1000 Subject: [PATCH] ckdb - event code check items for null before using them :P --- src/ckdb.h | 2 +- src/ckdb_data.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ckdb.h b/src/ckdb.h index 47d37b0c..f9afb5ea 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -51,7 +51,7 @@ #define DB_VLOCK "1" #define DB_VERSION "1.0.5" -#define CKDB_VERSION DB_VERSION"-2.004" +#define CKDB_VERSION DB_VERSION"-2.005" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ diff --git a/src/ckdb_data.c b/src/ckdb_data.c index 77cdca55..0743748c 100644 --- a/src/ckdb_data.c +++ b/src/ckdb_data.c @@ -4832,7 +4832,8 @@ int check_events(EVENTS *events) DATA_EVENTS_NULL(e, e_item); count = 0; // Remember the first username - STRNCPY(createby, e->createby); + if (e_item) + STRNCPY(createby, e->createby); user2 = false; while (e_item && e->id == events->id && strcmp(e->createinet, events->createinet) == 0 && @@ -4891,7 +4892,8 @@ int check_events(EVENTS *events) DATA_EVENTS_NULL(e, e_item); count = 0; // Remember the first username - STRNCPY(createby, e->createby); + if (e_item) + STRNCPY(createby, e->createby); user2 = false; while (e_item && e->id == events->id && strcmp(e->ipc, events->ipc) == 0 &&