[cfe-dev] Patch for bad close of file descriptor

Zhongxing Xu xuzhongxing at gmail.com
Sun Jul 18 18:55:30 PDT 2010


Hi Lei,

Looks good. I applied it with minor corrections. The test case is not
complete. The warning message is in the wrong line. This can be
spotted by running 'make test'.

On Sat, Jul 17, 2010 at 3:41 PM, 章磊 <ioripolo at gmail.com> wrote:
> Hi, Clang
>
> Here is a small patch for StreamChecker  to check the double close of fp.
>
> man fclose:
> The behaviour of fclose() is undefined if the stream parameter is an illegal
> pointer, or is a descriptor already passed to a  previous  invocation of
> fclose().
>
> It adds several states to file descriptor(just like what already done in
> MallocChecker).
>
> I'll appreciate it if there are any advice about this patch.
>
> --
> Best regards!
>
> Lei Zhang
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>




More information about the cfe-dev mailing list