[ntp:hackers] Bug in ntp_filegen.c?

Harlan Stenn stenn at ntp.isc.org
Tue May 29 12:43:15 PDT 2007


> >>> Around ntpd/ntp_filegen.c:393 there is:
> >>>
> >>>   if (gen->fp != NULL)
> >>>      fclose(gen->fp);
> >>>
> >>> and then around ntpd/ntp_filegen.c:415 there is:
> >>>
> >>>   if (gen->fp != NULL) {
> >>>      ...
> >>>   }
> >>>
> >>> I think this is wrong, or at least sloppy.

>> set gen->fp to NULL after fclose(gen->fp)

> The one problem with doing that is that it will never execute the code
> following the second if statement (line 415) so either that should be
> removed, the if statement should be removed or it should use a flag to
> conditionally call filegen_setup(). I have no idea what this code is
> meant to do so it's hard to know.

I was aware of that and used a flag to conditionally call
filegen_setup().

H


More information about the hackers mailing list