1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-06 03:32:09 +01: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".

Remove unnecessary declaration of MAX_PATH in BlockFile.h.
This commit is contained in:
v.audacity
2011-01-06 00:07:59 +00:00
parent 79e1db5ee6
commit 0332c60a2a
8 changed files with 49 additions and 52 deletions

View File

@@ -202,11 +202,8 @@ BlockFile *PCMAliasBlockFile::BuildFromXML(DirManager &dm, const wxChar **attrs)
const wxString strValue = value;
if (!wxStricmp(attr, wxT("summaryfile")) &&
// Can't use XMLValueChecker::IsGoodFileName here, but do part of its test.
XMLValueChecker::IsGoodFileString(strValue)
#ifdef _WIN32
&& (strValue.Length() + 1 + dm.GetProjectDataDir().Length() <= MAX_PATH)
#endif
)
XMLValueChecker::IsGoodFileString(strValue) &&
(strValue.Length() + 1 + dm.GetProjectDataDir().Length() <= PLATFORM_MAX_PATH))
{
if (!dm.AssignFile(summaryFileName, strValue, false))
// Make sure summaryFileName is back to uninitialized state so we can detect problem later.