Fixed accessing next log buffer only when it exists

Do not locate the next log buffer until it is known to exist.
This commit is contained in:
Jean-Pierre André 2015-12-01 11:12:53 +01:00
parent ca70766dc4
commit 5efc87cce8

View File

@ -3381,7 +3381,6 @@ static TRISTATE backward_rcrd(CONTEXT *ctx, u32 blk, int skipped,
if (prevbuf) if (prevbuf)
prevrph = &prevbuf->block.record; prevrph = &prevbuf->block.record;
data = buf->block.data; data = buf->block.data;
nextdata = nextbuf->block.data;
if (rph && (rph->head.magic == magic_RCRD) if (rph && (rph->head.magic == magic_RCRD)
&& (!prevrph || (prevrph->head.magic == magic_RCRD))) { && (!prevrph || (prevrph->head.magic == magic_RCRD))) {
if (optv) { if (optv) {
@ -3465,6 +3464,7 @@ static TRISTATE backward_rcrd(CONTEXT *ctx, u32 blk, int skipped,
&& ((k == endoff) || !endoff) && ((k == endoff) || !endoff)
&& ((u32)(k + LOG_RECORD_HEAD_SZ) <= blocksz)) { && ((u32)(k + LOG_RECORD_HEAD_SZ) <= blocksz)) {
if (nextbuf && (blk >= BASEBLKS)) { if (nextbuf && (blk >= BASEBLKS)) {
nextdata = nextbuf->block.data;
state = backoverlap(ctx, blk, state = backoverlap(ctx, blk,
data, nextdata, k); data, nextdata, k);
} }