This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Better realpath


On Saturday 14 June 2008 14:31:32 Pierre Muller wrote:
> I just looked at your patch and the idea seems
> good... But I am no expert on this field.
> 
>   One question though, libiberty lrealpath
> function uses strdup, while the replaced 
> code uses xstrdup.
>   xstrdup is also defined in libiberty
> as being a replacement of strdup that never
> fails... (didn't really get how this is
> possible...)
> 
>   Anyhow, is this a potential issue?

I don't think so. xstrdup is supposed to fail if it cannot get enough
memory. lrealpath, as it is now, will return NULL, but with my patch, 
there's a check for that in gdb_realpath -- and a call to nomem.

(And no, I did not think about that myself -- Dan suggested the
check and the call to nomem).

- Volodya


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]