mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-09 23:57:17 +01:00
fixed a potential buffer overrun in Path_WIN32U.cpp (noncritical, as the failing code should never be reached)
This commit is contained in:
parent
aed776b7ae
commit
a1b8f96111
@ -129,6 +129,7 @@ std::string PathImpl::tempHomeImpl()
|
||||
return tempImpl();
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::tempImpl()
|
||||
{
|
||||
char buffer[MAX_PATH];
|
||||
@ -166,6 +167,7 @@ std::string PathImpl::configImpl()
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::nullImpl()
|
||||
{
|
||||
return "NUL:";
|
||||
|
@ -139,6 +139,7 @@ std::string PathImpl::tempHomeImpl()
|
||||
return tempImpl();
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::tempImpl()
|
||||
{
|
||||
Buffer<wchar_t> buffer(MAX_PATH_LEN);
|
||||
@ -177,6 +178,7 @@ std::string PathImpl::configImpl()
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::nullImpl()
|
||||
{
|
||||
return "NUL:";
|
||||
@ -203,10 +205,11 @@ std::string PathImpl::expandImpl(const std::string& path)
|
||||
void PathImpl::listRootsImpl(std::vector<std::string>& roots)
|
||||
{
|
||||
roots.clear();
|
||||
wchar_t buffer[128];
|
||||
DWORD n = GetLogicalDriveStringsW(sizeof(buffer)/sizeof(wchar_t) - 1, buffer);
|
||||
const int bufferSize = 128;
|
||||
wchar_t buffer[bufferSize];
|
||||
DWORD n = GetLogicalDriveStringsW(bufferSize - 1, buffer);
|
||||
wchar_t* it = buffer;
|
||||
wchar_t* end = buffer + (n > sizeof(buffer) ? sizeof(buffer) : n);
|
||||
wchar_t* end = buffer + (n > bufferSize ? bufferSize : n);
|
||||
while (it < end)
|
||||
{
|
||||
std::wstring udev;
|
||||
|
@ -31,36 +31,43 @@ std::string PathImpl::currentImpl()
|
||||
return("\\");
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::homeImpl()
|
||||
{
|
||||
return("\\");
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::configHomeImpl()
|
||||
{
|
||||
return homeImpl();
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::dataHomeImpl()
|
||||
{
|
||||
return homeImpl();
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::cacheHomeImpl()
|
||||
{
|
||||
return homeImpl();
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::tempHomeImpl()
|
||||
{
|
||||
return tempImpl();
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::configImpl()
|
||||
{
|
||||
return("\\");
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::systemImpl()
|
||||
{
|
||||
return("\\");
|
||||
|
Loading…
x
Reference in New Issue
Block a user