[rtems commit] dosfs: Fix read from invalid memory area
Sebastian Huber
sebh at rtems.org
Fri May 16 14:33:56 UTC 2014
Module: rtems
Branch: master
Commit: 39840438bb3c29a0b890745f490a350a84470b75
Changeset: http://git.rtems.org/rtems/commit/?id=39840438bb3c29a0b890745f490a350a84470b75
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri May 16 15:34:33 2014 +0200
dosfs: Fix read from invalid memory area
---
cpukit/libfs/src/dosfs/msdos_conv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cpukit/libfs/src/dosfs/msdos_conv.c b/cpukit/libfs/src/dosfs/msdos_conv.c
index 7e688ef..b391717 100644
--- a/cpukit/libfs/src/dosfs/msdos_conv.c
+++ b/cpukit/libfs/src/dosfs/msdos_conv.c
@@ -631,7 +631,7 @@ msdos_filename_utf8_to_short_name_for_save (
* Strip any further characters up to a '.' or the end of the
* string.
*/
- if ( *name_ptr == '.' ) {
+ if ( name_size > 0 && *name_ptr == '.' ) {
++name_ptr;
--name_size;
}
More information about the vc
mailing list