Subject: Re: bug#9780: sort -u throws out non-duplicates

From: Paul Eggert <[email-masked]>
Date: Fri, 17 Aug 2012 13:01:48 -0700

On 08/17/2012 12:53 PM, Jim Meyering wrote:
> safe_text is initially NULL and we enter that block
> only when we're about to fread into a buffer that overlaps
> the current saved_line.text buffer.

Sorry, I wasn't clear enough.  I was worried about the
case when saved_line.text does not overlap the buffer
we're about to read into, because the buffer we're about
to read into has been realloc'ed.  The idea is that we
saved a line, then realloc'ed the buffer, and now we're
doing the overlap test.  There won't be an overlap (assuming
realloc gave us fresh space), but the saved line points
into freed memory.