mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-08 18:19:08 +08:00
Cygwin: path_conv::eq_worker: add NULL pointer checks
Don't call cstrdup on NULL pointers. This fixes a crash that was observed when cloning an fhandler whose path_conv member had freed its strings.
This commit is contained in:
parent
8de6b180c8
commit
84836642f9
@ -320,9 +320,11 @@ class path_conv
|
||||
contrast to statically allocated strings. Calling device::dup()
|
||||
will duplicate the string if the source was allocated. */
|
||||
dev.dup ();
|
||||
path = cstrdup (in_path);
|
||||
if (in_path)
|
||||
path = cstrdup (in_path);
|
||||
conv_handle.dup (pc.conv_handle);
|
||||
posix_path = cstrdup(pc.posix_path);
|
||||
if (pc.posix_path)
|
||||
posix_path = cstrdup(pc.posix_path);
|
||||
if (pc.wide_path)
|
||||
{
|
||||
wide_path = cwcsdup (uni_path.Buffer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user