Opened 12 years ago

Closed 12 years ago

#415 closed defect (fixed)

get_document() on an empty database raises floating point exception

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

Description

By empty, I mean a Database object uninitialised with any concrete databases.

Example code in python:

import xapian
db=xapian.Database()
db.get_document (1)

I would expect a DocNotFound exception.

Change History (3)

comment:1 by Olly Betts, 12 years ago

Component: OtherLibrary API
Milestone: 1.1.4

This is because we don't check internal.size() and then proceed to divide and modulus by 0.

In fact many methods of Xapian::Database currently fail to check this...

We should fix this before 1.1.4 - it's not showstopper bug, but it's easy to fix and low risk.

comment:2 by Olly Betts, 12 years ago

Milestone: 1.1.41.0.18
Status: newassigned

Fixed for all methods of Database in trunk r13668 (and noted ticket number in r13669).

Marking for backporting to 1.0.18.

comment:3 by Olly Betts, 12 years ago

Resolution: fixed
Status: assignedclosed

Backported in r13679.

Note: See TracTickets for help on using tickets.