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 23e7133516c3926697a4bda48a17fe9c0d0c2799..bb6505aec0d539c4cd74fdc88497531ee79f9641 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));