Dmitry Gorbachev

- lfn_get() reads past the end of name[]. Though harmless, it produces 'array subscript is above array bounds' compiler warning (treated as error).
See issue #3762 for more details.

svn path=/trunk/; revision=36661
This commit is contained in:
Aleksey Bragin 2008-10-06 10:19:55 +00:00
parent cbda8b5401
commit feb1e5232e

View file

@ -410,8 +410,12 @@ char *lfn_get( DIR_ENT *de )
}
}
for (sum = 0, i = 0; i < 11; i++)
for (sum = 0, i = 0; i < 8; i++)
sum = (((sum&1) << 7) | ((sum&0xfe) >> 1)) + de->name[i];
for (i = 0; i < 3; i++)
sum = (((sum&1) << 7) | ((sum&0xfe) >> 1)) + de->ext[i];
if (sum != lfn_checksum) {
/* checksum doesn't match, long name doesn't apply to this alias */
/* Causes: 1) alias renamed */