X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Frecindex.c;h=9b6af8823f15a62cfc3cf45665c96ea15922bb95;hb=9982694ca69efc2bf4db54cd5b5607e3680cd32a;hp=00c9c95f2512e69af98de81a6b324f5e71e6a741;hpb=b3af54f7bf58db2a5d85b6a54b720bf6c5359c1f;p=idzebra-moved-to-github.git diff --git a/index/recindex.c b/index/recindex.c index 00c9c95..9b6af88 100644 --- a/index/recindex.c +++ b/index/recindex.c @@ -1,5 +1,5 @@ -/* $Id: recindex.c,v 1.54 2006-11-21 22:17:49 adam Exp $ - Copyright (C) 1995-2006 +/* $Id: recindex.c,v 1.56 2007-01-15 15:10:17 adam Exp $ + Copyright (C) 1995-2007 Index Data ApS This file is part of the Zebra server. @@ -202,6 +202,8 @@ static ZEBRA_RES rec_delete_single(Records p, Record rec) { struct record_index_entry entry; + /* all data in entry must be reset, since it's written verbatim */ + memset(&entry, '\0', sizeof(entry)); if (rec_release_blocks(p, rec_sysno_to_int(rec->sysno)) != ZEBRA_OK) return ZEBRA_FAIL; @@ -221,6 +223,9 @@ static ZEBRA_RES rec_write_tmp_buf(Records p, int size, zint *sysnos) int dst_type = 0; int i; + /* all data in entry must be reset, since it's written verbatim */ + memset(&entry, '\0', sizeof(entry)); + for (i = 1; i= p->head.block_move[i]) dst_type = i; @@ -279,6 +284,7 @@ Records rec_open(BFiles bfs, int rw, int compression_method) ZEBRA_RES ret = ZEBRA_OK; p = (Records) xmalloc(sizeof(*p)); + memset(&p->head, '\0', sizeof(p->head)); p->compression_method = compression_method; p->rw = rw; p->tmp_size = 1024;