This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix nss_db crash when db contains exactly one entry
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: "Carlos O'Donell" <carlos at systemhalted dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 27 Nov 2012 22:24:22 +0530
- Subject: Re: [PATCH] Fix nss_db crash when db contains exactly one entry
- References: <20121127154339.GK11387@spoyarek.pnq.redhat.com><CAE2sS1gtBRR2twBwMkQ-8c7BL-kO=H1BM406XAL=PVx8muZg1A@mail.gmail.com>
On Tue, Nov 27, 2012 at 11:42:46AM -0500, Carlos O'Donell wrote:
>
> Please inline your patches, it makes it *way* easier to review and comment.
>
Ah I noticed that after I posted them. I switched to mutt recently
and I guess I need to fix something in my muttrc.
> The function is a modified `Trial Division' algorithm for computing
> the next prime.
>
> Please replace it with a correctly working Trial Division algorithm
> that uses squaring to avoid square roots. Then we can remove the
> quirky restrictions and end up with a robust piece of code that
> doesn't fail in weird corner cases.
>
> I suggest looking at:
> http://en.literateprograms.org/Trial_division_%28C%29
>
> I suggest against a Sieve of Eratosthenes because it increases the
> memory required by the computation. Keep it simple and low memory.
>
OK thanks, I'll send an updated patch soon.
Siddhesh