Avoid memory illegal access detected by Coverity Scan

This commit is contained in:
Carles Fernandez 2023-12-02 12:51:33 +01:00
parent 1685c896ea
commit 4afee8b7be
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
1 changed files with 1 additions and 0 deletions

View File

@ -5225,6 +5225,7 @@ int expath(const char *path, char *paths[], int nmax)
if (strlen(paths[i]) < 1025)
{
std::strncpy(tmp, paths[i], 1024);
tmp[1023] = '\0';
}
else
{