From f1e790d439c9621b3f1a3310f6cf648e7fbbb640 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 27 Aug 2010 06:41:08 +0000 Subject: 2010-08-26 Sebastian Huber * libcsupport/src/mount.c, libcsupport/src/mount-mgr.c: Avoid strcpy(). --- cpukit/libcsupport/src/mount-mgr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cpukit/libcsupport/src/mount-mgr.c') 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; -- cgit v1.2.3