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
140b0a6484
commit
22d1ebacfc
|
@ -320,8 +320,10 @@ class path_conv
|
||||||
contrast to statically allocated strings. Calling device::dup()
|
contrast to statically allocated strings. Calling device::dup()
|
||||||
will duplicate the string if the source was allocated. */
|
will duplicate the string if the source was allocated. */
|
||||||
dev.dup ();
|
dev.dup ();
|
||||||
|
if (in_path)
|
||||||
path = cstrdup (in_path);
|
path = cstrdup (in_path);
|
||||||
conv_handle.dup (pc.conv_handle);
|
conv_handle.dup (pc.conv_handle);
|
||||||
|
if (pc.posix_path)
|
||||||
posix_path = cstrdup(pc.posix_path);
|
posix_path = cstrdup(pc.posix_path);
|
||||||
if (pc.wide_path)
|
if (pc.wide_path)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue