[rtems commit] Filesystem: Preserve source NULL pointer in mount

Sebastian Huber sebh at rtems.org
Tue Nov 13 08:35:36 UTC 2012


Module:    rtems
Branch:    master
Commit:    3c1d387523b99986baf004c8621513f3fb05cb96
Changeset: http://git.rtems.org/rtems/commit/?id=3c1d387523b99986baf004c8621513f3fb05cb96

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Nov  9 16:02:02 2012 +0100

Filesystem: Preserve source NULL pointer in mount

---

 cpukit/libcsupport/src/mount.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/cpukit/libcsupport/src/mount.c b/cpukit/libcsupport/src/mount.c
index a6c4321..8eb4796 100644
--- a/cpukit/libcsupport/src/mount.c
+++ b/cpukit/libcsupport/src/mount.c
@@ -10,7 +10,7 @@
  *  COPYRIGHT (c) 1989-2010.
  *  On-Line Applications Research Corporation (OAR).
  *
- *  Copyright (c) 2010 embedded brains GmbH.
+ *  Copyright (c) 2010-2012 embedded brains GmbH.
  *
  *  The license and distribution terms for this file may be
  *  found in the file LICENSE in this distribution or at
@@ -73,9 +73,11 @@ static rtems_filesystem_mount_table_entry_t *alloc_mount_table_entry(
     mt_entry->type = str;
     str += filesystemtype_size;
 
-    memcpy( str, source_or_null, source_size );
-    mt_entry->dev = str;
-    str += source_size;
+    if ( source_or_null != NULL ) {
+      memcpy( str, source_or_null, source_size );
+      mt_entry->dev = str;
+      str += source_size;
+    }
 
     memcpy( str, target, target_size );
     mt_entry->target = str;




More information about the vc mailing list