Make realy shure we don't put a NULL into memcpy
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 28 Sep 2013 16:48:36 +0000 (18:48 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 28 Sep 2013 16:48:36 +0000 (18:48 +0200)
citadel/database.c

index 23e7133..bb6505a 100644 (file)
@@ -908,7 +908,7 @@ time_t CheckIfAlreadySeen(const char *Facility,
        {
                SEENM_syslog(LOG_DEBUG, "Loading");
                cdbut = cdb_fetch(CDB_USETABLE, SKEY(guid));
-               if (cdbut != NULL) {
+               if ((cdbut != NULL) && (cdbut->ptr != NULL)) {
                        memcpy(&ut, cdbut->ptr,
                               ((cdbut->len > sizeof(struct UseTable)) ?
                                sizeof(struct UseTable) : cdbut->len));