Andrew Cooper writes ("Re: [Xen-devel] [PATCH v2 01/11] tools/libs/toollog: 
Provide a default logger"):
> Although actually, you can't capture stderr in a variable like this at
> all.  freopen() at a later point will close the current FILE object and
> create a new one, after which this logger will use-after-free.

freopen(...,f) always returns NULL or f.  There's no way to change the
pointer value of stderr.  Indeed some libcs have
  #define stderr (&__stdiostreams[2])
or some such.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to