Forum: Ferret Bug in IndexSearcher with limit => all and any offset

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
ahFeel (Guest)
on 2007-02-16 11:33
Here's the deal:

static TopDocs *isea_search_w(Searcher *self,
                              Weight *weight,
                              int first_doc, // OFFSET
                              int num_docs, // LIMIT
                              Filter *filter,
                              Sort *sort,
                              filter_ft filter_func,
                              bool load_fields)
{
    int max_size = first_doc + num_docs;

Actually, when you have limit => :all, num_docs equals to INT_MAX, so
adding a value to it makes a nice int overflow :/

The diff patch is here:
http://pastie.caboo.se/40748

I've told Dave by mail but it seems like he's very busy lately, hope
someone else can release some fix here :)

--
Jérémie 'ahFeel' BORDIER
Rift Technologies - http://www.rift.fr
David B. (Guest)
on 2007-02-22 09:34
(Received via mailing list)
On 2/16/07, ahFeel <removed_email_address@domain.invalid> wrote:
> {
>     int max_size = first_doc + num_docs;
>
> Actually, when you have limit => :all, num_docs equals to INT_MAX, so
> adding a value to it makes a nice int overflow :/
>
> The diff patch is here:
> http://pastie.caboo.se/40748
>
> I've told Dave by mail but it seems like he's very busy lately, hope
> someone else can release some fix here :)

Thanks Jérémie, this bug has been fixed.
This topic is locked and can not be replied to.