Changeset 674f8b1b in rtems


Ignore:
Timestamp:
Mar 16, 2015, 5:23:36 PM (5 years ago)
Author:
Jamie Iles <jamie@…>
Branches:
4.11, master
Children:
a2ba004
Parents:
a62220fe
git-author:
Jamie Iles <jamie@…> (03/16/15 17:23:36)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/16/15 18:17:35)
Message:

IMFS: don't strlen() an unterminated string in IMFS_dir_read().

a43a3466 (IMFS: Implement variable length node names) introduced a
changed to IMFS_jnode_t from being a null terminated string to a
separate unterminated string and length. IMFS_dir_read() was still
performing a strlen() on this unterminated string though and when doing
an 'ls' in the fileio example I saw that some filenames had garbage
suffixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/imfs/imfs_dir_default.c

    ra62220fe r674f8b1b  
    7474         dir_ent->d_reclen = sizeof( *dir_ent );
    7575         dir_ent->d_ino = IMFS_node_to_ino( imfs_node );
    76          dir_ent->d_namlen = strlen( imfs_node->name );
     76         dir_ent->d_namlen = imfs_node->namelen;
    7777         memcpy( dir_ent->d_name, imfs_node->name, dir_ent->d_namlen + 1 );
    7878
Note: See TracChangeset for help on using the changeset viewer.