]> sourceware.org Git - newlib-cygwin.git/commitdiff
* path.cc (path_conv::get_nt_native_path): Avoid dereferencing path when it is
authorChristopher Faylor <me@cgf.cx>
Sun, 23 Oct 2011 17:19:17 +0000 (17:19 +0000)
committerChristopher Faylor <me@cgf.cx>
Sun, 23 Oct 2011 17:19:17 +0000 (17:19 +0000)
NULL.

winsup/cygwin/ChangeLog
winsup/cygwin/path.cc

index 08c12cfc8ed3bbd8ce9e474470675c5750e1a219..19ee92fd3c396584ceef5cfe8ea9e6a453c10e3f 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-23  Christopher Faylor  <me.cygwin2011@cgf.cx>
+
+       * path.cc (path_conv::get_nt_native_path): Avoid dereferencing path
+       when it is NULL.
+
 2011-10-21  Christopher Faylor  <me.cygwin2011@cgf.cx>
 
        * dtable.cc (dtable::delete_archetype): Improve debugging output.
        (operator <<): New function.
        (operator =): Use eq_worker to perform old functionality.
 
+       * child_info.h (NPROCS): Move here from sigproc.cc.
+       (child_info::nprocs): New field.  Not used yet.
+       (child_info::children):: Ditto.
+
 2011-10-21  Corinna Vinschen  <corinna@vinschen.de>
 
        * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Check invalid
index 97cf9e5d4d156c4eae2ee26f64f50905859df4aa..021e7dff4ceccd05780609d63719bda76474505b 100644 (file)
@@ -450,15 +450,21 @@ get_nt_native_path (const char *path, UNICODE_STRING& upath, bool dos)
 PUNICODE_STRING
 path_conv::get_nt_native_path ()
 {
-  if (!wide_path)
+  PUNICODE_STRING res;
+  if (wide_path)
+    res = &uni_path;
+  else if (!path)
+    res = NULL;
+  else
     {
       uni_path.Length = 0;
       uni_path.MaximumLength = (strlen (path) + 10) * sizeof (WCHAR);
       wide_path = (PWCHAR) cmalloc_abort (HEAP_STR, uni_path.MaximumLength);
       uni_path.Buffer = wide_path;
       ::get_nt_native_path (path, uni_path, has_dos_filenames_only ());
+      res = &uni_path;
     }
-  return &uni_path;
+  return res;
 }
 
 PWCHAR
This page took 0.038153 seconds and 5 git commands to generate.