[PATCH] Fix nss_db crash when db contains exactly one entry

Siddhesh Poyarekar siddhesh@redhat.com
Tue Nov 27 16:54:00 GMT 2012


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



More information about the Libc-alpha mailing list