preliminary fix for bug #73971, more refactoring is needed

This commit is contained in:
Anatol Belski 2017-01-22 22:43:53 +01:00
parent 8782e847b4
commit 609507024f
3 changed files with 57 additions and 3 deletions

View file

@ -103,7 +103,7 @@ struct dirent *readdir(DIR *dp)
/* wide to utf8 failed, should never happen. */
return NULL;
}
strlcpy(dp->dent.d_name, _tmp, _MAX_FNAME+1);
strlcpy(dp->dent.d_name, _tmp, _MAX_FNAME*4+1);
dp->dent.d_reclen = (unsigned short)strlen(dp->dent.d_name);
free(_tmp);
@ -138,7 +138,7 @@ int readdir_r(DIR *dp, struct dirent *entry, struct dirent **result)
result = NULL;
return 0;
}
strlcpy(dp->dent.d_name, _tmp, _MAX_FNAME+1);
strlcpy(dp->dent.d_name, _tmp, _MAX_FNAME*4+1);
dp->dent.d_reclen = (unsigned short)strlen(dp->dent.d_name);
free(_tmp);