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>
Mon, 7 Oct 2013 19:33:11 +0000 (21:33 +0200)
citadel/database.c

index b3a67d69b36368ecab49944c149314ea7efdea57..d9080a5d716c58f39817de085cd77a217c2c213b 100644 (file)
@@ -931,7 +931,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));