From 04e23a08890f322be2ed4686d311632ca18d0a62 Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Thu, 6 Jan 2011 03:09:21 +0000 Subject: [PATCH] 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". --- src/blockfile/SimpleBlockFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blockfile/SimpleBlockFile.cpp b/src/blockfile/SimpleBlockFile.cpp index ee2143bb2..7b463880a 100644 --- a/src/blockfile/SimpleBlockFile.cpp +++ b/src/blockfile/SimpleBlockFile.cpp @@ -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.