Changeset 21d7154b in rtems


Ignore:
Timestamp:
Mar 14, 2017, 12:59:09 PM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11
Children:
c38f1fcf
Parents:
f08c7133
git-author:
Sebastian Huber <sebastian.huber@…> (03/14/17 12:59:09)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/21/17 15:14:37)
Message:

dosfs: Fix msdos_utf8_normalize_and_fold()

It is all right in case the result uses the full destination buffer.
Without this fix the handling of a maximum 8.3 short file name is
broken.

Close #2928.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/dosfs/msdos_conv_utf8.c

    rf08c7133 r21d7154b  
    223223
    224224  if ( result >= 0 ) {
    225     if ( result < unicode_buf_size ) {
     225    if ( result <= unicode_buf_size ) {
    226226      unicodes_to_reencode = result;
    227227    } else {
    228       unicodes_to_reencode = unicode_buf_size - 1;
     228      unicodes_to_reencode = unicode_buf_size;
    229229      eno = ENOMEM;
    230230    }
  • testsuites/fstests/fsdosfsname01/init.c

    rf08c7133 r21d7154b  
    10931093}
    10941094
     1095static void test_full_8_3_name( void )
     1096{
     1097  int rc;
     1098
     1099  rc = mkdir( MOUNT_DIR "/txtvsbin.txt", S_IRWXU | S_IRWXG | S_IRWXO );
     1100  rtems_test_assert( rc == 0 );
     1101
     1102  rc = unlink( MOUNT_DIR "/txtvsbin.txt" );
     1103  rtems_test_assert( rc == 0 );
     1104}
     1105
     1106static void test_special_cases( void )
     1107{
     1108  test_end_of_string_matches();
     1109  test_full_8_3_name();
     1110}
     1111
    10951112/*
    10961113 * Main test method
     
    11511168    NULL);
    11521169
    1153   test_end_of_string_matches();
     1170  test_special_cases();
    11541171
    11551172  rc = unmount( MOUNT_DIR );
     
    12211238    &mount_opts[1]);
    12221239
    1223   test_end_of_string_matches();
     1240  test_special_cases();
    12241241
    12251242  rc = unmount( MOUNT_DIR );
     
    12861303    &mount_opts[1]);
    12871304
    1288   test_end_of_string_matches();
     1305  test_special_cases();
    12891306
    12901307  rc = unmount( MOUNT_DIR );
Note: See TracChangeset for help on using the changeset viewer.