[PATCH] dosfs: avoid buffer-overread. closes #2292.

Gedare Bloom gedare at rtems.org
Wed Mar 11 13:56:00 UTC 2015


---
 cpukit/libfs/src/dosfs/msdos_misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c
index fdac613..76dff43 100644
--- a/cpukit/libfs/src/dosfs/msdos_misc.c
+++ b/cpukit/libfs/src/dosfs/msdos_misc.c
@@ -1055,8 +1055,8 @@ msdos_get_utf16_string_from_long_entry (
 
         if (is_first_entry) {
             for (chars_in_entry = 0;
-                 (    entry_string_buf[chars_in_entry] != 0x0000
-                  && chars_in_entry < MSDOS_LFN_LEN_PER_ENTRY );
+                 (   chars_in_entry < MSDOS_LFN_LEN_PER_ENTRY
+                  && entry_string_buf[chars_in_entry] != 0x0000);
                   ++chars_in_entry) {
                 ;
             }
-- 
1.9.1



More information about the devel mailing list