Opened 21 years ago

Last modified 19 years ago

#28 closed defect (released)

Uninitialised memory referenced with partial match

Reported by: Richard Boulton Owned by: Olly Betts
Priority: high Milestone:
Component: Library API Version: SVN trunk
Severity: normal Keywords:
Cc: Robert Pollak Blocked By:
Blocking: Operating System: Linux

Description

Following these steps causes Xapian to reference uninitialised memory:

1) Perform a search which matches, say, 5 documents. 2) Call get_mset(1, 10) - ie, starting at the second hit, and returning more hits than are available. 3) Iterate through the resulting mset, calling get_document() on each item returned. 4) When the iteration reaches the 5th document, get_document() will refer to uninitialised memory.

The attached patch to apitest demonstrates this problem - to reliably cause the test to fail it needs to be run under valgrind.

Attachments (1)

diffs (1.3 KB ) - added by Richard Boulton 21 years ago.
Testcase (patch to api_db.cc)

Download all attachments as: .zip

Change History (3)

by Richard Boulton, 21 years ago

Attachment: diffs added

Testcase (patch to api_db.cc)

comment:1 by Olly Betts, 21 years ago

Resolution: fixed
Status: newclosed, robert.pollak@fabasoft.com

We were failing to subtract firstitem when indexing into items. Will be fixed in CVS HEAD shortly (I'm just looking for a testcase which doesn't require valgrind).

comment:2 by Olly Betts, 20 years ago

Operating System: Linux
Resolution: fixedreleased

Fixed in 0.8.1

Note: See TracTickets for help on using tickets.