Bug in fd.c (FreeFile)

Поиск
Список
Период
Сортировка
Искать

Bug in fd.c (FreeFile)

От:
Claudio Natoli <claudio.natoli@memetrics.com>
Дата:
Вложения:

I believe FreeFile has an "off by one" type error. Apart from possibly
accessing past the end of the array, when combined with the while loop call
from CleanupTempFiles, it contrives to fail to fclose a number of files [at
a guess, floor((numAllocatedFiles-1)/2)] when CleanupTempFiles is called
(unless I'm completely mistaken).

Change 1: Begin search from "correct" [logical] final element of array
Change 2: Minor speed-up to CleanupTempFiles (knowing that FreeFile iterates
from the [logical] 
final element of the array)

Apply to HEAD (bug also exists in 7.4 branch, possibly others...)

Cheers,
Claudio

--- 
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see 
http://www.memetrics.com/em
ailpolicy.html
  

Re: Bug in fd.c (FreeFile)

От:
Claudio Natoli <claudio.natoli@memetrics.com>
Дата:
Nope. My bad. My head has an off by one error.

Drop the first part of the patch, but the second part could be retained.
Very minor.

Off to hide in shame,
Claudio

> -----Original Message-----
> From: Claudio Natoli [mailto:claudio.natoli@memetrics.com]
> Sent: Wednesday, 26 November 2003 12:34 PM
> To: pgsql-patches@postgresql.org
> Subject: [PATCHES] Bug in fd.c (FreeFile)
> 
> 
> 
> I believe FreeFile has an "off by one" type error. Apart from possibly
> accessing past the end of the array, when combined with the 
> while loop call
> from CleanupTempFiles, it contrives to fail to fclose a 
> number of files [at
> a guess, floor((numAllocatedFiles-1)/2)] when 
> CleanupTempFiles is called
> (unless I'm completely mistaken).
> 
> Change 1: Begin search from "correct" [logical] final element of array
> Change 2: Minor speed-up to CleanupTempFiles (knowing that 
> FreeFile iterates
> from the [logical] 
> final element of the array)
> 
> Apply to HEAD (bug also exists in 7.4 branch, possibly others...)
> 
> Cheers,
> Claudio
> 
> --- 
> Certain disclaimers and policies apply to all email sent from 
> Memetrics.
> For the full text of these disclaimers and policies see 
>  href="http://www.memetrics.com/emailpolicy.html">http://www.me
> metrics.com/em
> ailpolicy.html
>   
> 
> 

--- 
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see 
http://www.memetrics.com/em
ailpolicy.html
FAQ