1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-28 06:08:40 +02:00

Define one constant, PLATFORM_MAX_PATH, for maximum path value, so we don't have to do platform-specific conditionals everywhere we want to check it. In fact, we were actually checking that only for Windows. This is follow-on to Richard's message on audacity-devel about "overflow vulns".

This commit is contained in:
v.audacity 2011-01-06 03:09:21 +00:00
parent 0332c60a2a
commit 04e23a0889

View File

@ -491,7 +491,7 @@ BlockFile *SimpleBlockFile::BuildFromXML(DirManager &dm, const wxChar **attrs)
if (!wxStricmp(attr, wxT("filename")) &&
// Can't use XMLValueChecker::IsGoodFileName here, but do part of its test.
XMLValueChecker::IsGoodFileString(strValue) &&
(strValue.Length() + 1 + dm.GetProjectDataDir().Length() <= MAX_PATH))
(strValue.Length() + 1 + dm.GetProjectDataDir().Length() <= PLATFORM_MAX_PATH))
{
if (!dm.AssignFile(fileName, strValue, false))
// Make sure fileName is back to uninitialized state so we can detect problem later.