change log for rtems (2010-08-27)

rtems-vc at rtems.org rtems-vc at rtems.org
Fri Aug 27 07:10:24 UTC 2010


 *sh*:
2010-08-26	Sebastian Huber <sebastian.huber at embedded-brains.de>

	* libcsupport/src/mount.c: Avoid strcpy().

M 1.2609  cpukit/ChangeLog
M   1.41  cpukit/libcsupport/src/mount.c

diff -u rtems/cpukit/ChangeLog:1.2608 rtems/cpukit/ChangeLog:1.2609
--- rtems/cpukit/ChangeLog:1.2608	Thu Aug 26 16:42:21 2010
+++ rtems/cpukit/ChangeLog	Fri Aug 27 01:29:25 2010
@@ -1,3 +1,7 @@
+2010-08-26	Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+	* libcsupport/src/mount.c: Avoid strcpy().
+
 2010-08-26	Joel Sherrill <joel.sherrill at oarcorp.com>
 
 	* libcsupport/src/sync.c: Add comment explaining why the return value

diff -u rtems/cpukit/libcsupport/src/mount.c:1.40 rtems/cpukit/libcsupport/src/mount.c:1.41
--- rtems/cpukit/libcsupport/src/mount.c:1.40	Sun Jul  4 09:53:44 2010
+++ rtems/cpukit/libcsupport/src/mount.c	Fri Aug 27 01:29:26 2010
@@ -74,29 +74,27 @@
   size_t filesystemtype_size = strlen( filesystemtype ) + 1;
   size_t source_size = source_or_null != NULL ?
     strlen( source_or_null ) + 1 : 0;
-  size_t target_length = strlen( target );
+  size_t target_size = strlen( target ) + 1;
   size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
-    + filesystemtype_size + source_size + target_length + 1;
+    + filesystemtype_size + source_size + target_size;
   rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
 
   if ( mt_entry != NULL ) {
     char *str = (char *) mt_entry + sizeof( *mt_entry );
 
-    strcpy( str, filesystemtype );
+    memcpy( str, filesystemtype, filesystemtype_size );
     mt_entry->type = str;
     str += filesystemtype_size;
 
-    if ( source_or_null != NULL ) {
-      strcpy( str, source_or_null );
-      mt_entry->dev = str;
-      str += source_size;
-    }
+    memcpy( str, source_or_null, source_size );
+    mt_entry->dev = str;
+    str += source_size;
 
-    strcpy( str, target );
+    memcpy( str, target, target_size );
     mt_entry->target = str;
   }
 
-  *target_length_ptr = target_length;
+  *target_length_ptr = target_size - 1;
 
   return mt_entry;
 }


 *sh*:
2010-08-26	Sebastian Huber <sebastian.huber at embedded-brains.de>

	* libcsupport/src/mount.c, libcsupport/src/mount-mgr.c: Avoid
	strcpy().

M 1.2610  cpukit/ChangeLog
M    1.6  cpukit/libcsupport/src/mount-mgr.c

diff -u rtems/cpukit/ChangeLog:1.2609 rtems/cpukit/ChangeLog:1.2610
--- rtems/cpukit/ChangeLog:1.2609	Fri Aug 27 01:29:25 2010
+++ rtems/cpukit/ChangeLog	Fri Aug 27 01:41:07 2010
@@ -1,6 +1,7 @@
 2010-08-26	Sebastian Huber <sebastian.huber at 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 at oarcorp.com>
 

diff -u rtems/cpukit/libcsupport/src/mount-mgr.c:1.5 rtems/cpukit/libcsupport/src/mount-mgr.c:1.6
--- rtems/cpukit/libcsupport/src/mount-mgr.c:1.5	Sun Jul  4 09:53:44 2010
+++ rtems/cpukit/libcsupport/src/mount-mgr.c	Fri Aug 27 01:41:08 2010
@@ -110,14 +110,15 @@
   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;
 


 *sh*:
2010-08-26	Sebastian Huber <sebastian.huber at embedded-brains.de>

	* libfs/src/defaults/default_evalpath.c,
	libfs/src/defaults/default_evaluate_link.c: Removed superfluous
	assignment.

M 1.2611  cpukit/ChangeLog
M    1.4  cpukit/libfs/src/defaults/default_evalpath.c
M    1.2  cpukit/libfs/src/defaults/default_evaluate_link.c

diff -u rtems/cpukit/ChangeLog:1.2610 rtems/cpukit/ChangeLog:1.2611
--- rtems/cpukit/ChangeLog:1.2610	Fri Aug 27 01:41:07 2010
+++ rtems/cpukit/ChangeLog	Fri Aug 27 01:42:45 2010
@@ -1,5 +1,11 @@
 2010-08-26	Sebastian Huber <sebastian.huber at embedded-brains.de>
 
+	* libfs/src/defaults/default_evalpath.c,
+	libfs/src/defaults/default_evaluate_link.c: Removed superfluous
+	assignment.
+
+2010-08-26	Sebastian Huber <sebastian.huber at embedded-brains.de>
+
 	* libcsupport/src/mount.c, libcsupport/src/mount-mgr.c: Avoid
 	strcpy().
 

diff -u rtems/cpukit/libfs/src/defaults/default_evalpath.c:1.3 rtems/cpukit/libfs/src/defaults/default_evalpath.c:1.4
--- rtems/cpukit/libfs/src/defaults/default_evalpath.c:1.3	Tue Jun 29 14:37:28 2010
+++ rtems/cpukit/libfs/src/defaults/default_evalpath.c	Fri Aug 27 01:42:45 2010
@@ -20,7 +20,6 @@
   rtems_filesystem_location_info_t  *pathloc        /* IN/OUT */
 )
 {
-  pathloc = NULL;
   rtems_set_errno_and_return_minus_one( ENOTSUP );
 }
 

diff -u rtems/cpukit/libfs/src/defaults/default_evaluate_link.c:1.1 rtems/cpukit/libfs/src/defaults/default_evaluate_link.c:1.2
--- rtems/cpukit/libfs/src/defaults/default_evaluate_link.c:1.1	Tue Jun 29 14:37:28 2010
+++ rtems/cpukit/libfs/src/defaults/default_evaluate_link.c	Fri Aug 27 01:42:46 2010
@@ -18,7 +18,6 @@
   int                               flags        /* IN     */
 )
 {
-  pathloc = NULL;
   rtems_set_errno_and_return_minus_one( ENOTSUP );
 }
 



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100827/2cd034ef/attachment.html>


More information about the vc mailing list