change log for rtems (2010-06-10)

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jun 11 06:59:27 UTC 2010


On 06/11/2010 12:38 AM, Chris Johns wrote:
> On 10/06/10 9:11 PM, rtems-vc at rtems.org wrote:
>> @@ -213,7 +203,6 @@
>>      */
>>
>>     rtems_filesystem_freenode( fs_mount_loc );
>> -  free( (void*) mt_entry->target );
>>     free( mt_entry );
>>
> 
> This change is broken. I see you have removed the strdup from the mount
> command. You cannot assume the target memory supplied to mount is always
> present. It may have been allocated on the heap and returned to the heap
> after. My original code handled the target cleanly and I did not sorry
> about the source as it was already coping by reference. I think both
> need to be handled with a copy by value. I can see cases where sprintf
> happens in a loop with a stack based buffer for multiple devices.
> 
> Chris
> _______________________________________________
> rtems-vc mailing list
> rtems-vc at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-vc

I changed the mt_entry allocation entirely, see alloc_mount_table_entry().  The
source, target and filesystemtype strings will be copied now.

The problem with your first approach was that you simply assigned the type
pointer of the file system table entry to the mount table entry.  It is
possible that a file system table entry vanishes with
rtems_filesystem_unregister() and thus the storage of the type string.

It is also not that good to cast a const-qualifier away.

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the vc mailing list