Browse Source

ckdb - event code check items for null before using them :P

master
kanoi 9 years ago
parent
commit
a0fbee4ae5
  1. 2
      src/ckdb.h
  2. 6
      src/ckdb_data.c

2
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__

6
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 &&

Loading…
Cancel
Save