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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user