Read_dir_callback(): prevent buffer overrun
This commit is contained in:
@@ -318,7 +318,7 @@ static void Read_dir_callback(void * pdata, const char *file_name, const word *u
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
pos_last_dot++;
|
pos_last_dot++;
|
||||||
for (i = 0; i < (int)sizeof(long_ext) - 1; i++)
|
for (i = 0; i < (int)sizeof(long_ext) - 1 && unicode_name[pos_last_dot + i] != 0; i++)
|
||||||
long_ext[i] = (unicode_name[pos_last_dot + i] < 256) ? unicode_name[pos_last_dot + i] : '?';
|
long_ext[i] = (unicode_name[pos_last_dot + i] < 256) ? unicode_name[pos_last_dot + i] : '?';
|
||||||
long_ext[i] = '\0';
|
long_ext[i] = '\0';
|
||||||
file_name_ext = long_ext;
|
file_name_ext = long_ext;
|
||||||
|
|||||||
Reference in New Issue
Block a user