summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/ChangeLog3
-rw-r--r--cpukit/libcsupport/src/mount-mgr.c7
2 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index cc56e3cb93..aa4d88bba4 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,6 +1,7 @@
2010-08-26 Sebastian Huber <sebastian.huber@embedded-brains.de>
- * libcsupport/src/mount.c: Avoid strcpy().
+ * libcsupport/src/mount.c, libcsupport/src/mount-mgr.c: Avoid
+ strcpy().
2010-08-26 Joel Sherrill <joel.sherrill@oarcorp.com>
diff --git a/cpukit/libcsupport/src/mount-mgr.c b/cpukit/libcsupport/src/mount-mgr.c
index 755532aa0d..c610ff6998 100644
--- a/cpukit/libcsupport/src/mount-mgr.c
+++ b/cpukit/libcsupport/src/mount-mgr.c
@@ -110,14 +110,15 @@ rtems_filesystem_register(
rtems_filesystem_fsmount_me_t mount_h
)
{
- size_t fsn_size = sizeof( filesystem_node ) + strlen(type) + 1;
+ size_t type_size = strlen(type) + 1;
+ size_t fsn_size = sizeof( filesystem_node ) + type_size;
filesystem_node *fsn = malloc( fsn_size );
- char *type_storage = (char *) fsn + sizeof( filesystem_node );
+ char *type_storage = (char *) fsn + sizeof( *fsn );
if ( fsn == NULL )
rtems_set_errno_and_return_minus_one( ENOMEM );
- strcpy(type_storage, type);
+ memcpy(type_storage, type, type_size);
fsn->entry.type = type_storage;
fsn->entry.mount_h = mount_h;