summaryrefslogtreecommitdiff
path: root/osdep
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2015-11-13 12:14:28 -0800
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2015-11-13 12:14:28 -0800
commit0d9f33dc4f14b7339d1893e79772a8e49b4821eb (patch)
treee7b3e1ee8ec92d57ce71482c64738f4211e5d9ff /osdep
parent90f9415107fded22346bfa94f98afa73c6c2811e (diff)
downloadinfinitytier-0d9f33dc4f14b7339d1893e79772a8e49b4821eb.tar.gz
infinitytier-0d9f33dc4f14b7339d1893e79772a8e49b4821eb.zip
Fix: (1) Windows stack overflow due to buffer too large in peer deserialize, (2) clean up some other stuff seen during debugging and reduce the sizes of some buffers due to Windows small stack size, (3) remove a redundant try/catch.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/OSUtils.cpp2
-rw-r--r--osdep/WindowsEthernetTap.cpp20
2 files changed, 11 insertions, 11 deletions
diff --git a/osdep/OSUtils.cpp b/osdep/OSUtils.cpp
index 45fbf100..728704e5 100644
--- a/osdep/OSUtils.cpp
+++ b/osdep/OSUtils.cpp
@@ -206,7 +206,7 @@ skip_add_inetaddr:
bool OSUtils::readFile(const char *path,std::string &buf)
{
- char tmp[4096];
+ char tmp[1024];
FILE *f = fopen(path,"rb");
if (f) {
for(;;) {
diff --git a/osdep/WindowsEthernetTap.cpp b/osdep/WindowsEthernetTap.cpp
index f327009d..5b2bc154 100644
--- a/osdep/WindowsEthernetTap.cpp
+++ b/osdep/WindowsEthernetTap.cpp
@@ -213,7 +213,7 @@ std::string WindowsEthernetTap::addNewPersistentTapDevice(const char *pathToInf,
Mutex::Lock _l(_systemDeviceManagementLock);
GUID classGuid;
- char className[4096];
+ char className[1024];
if (!WINENV.SetupDiGetINFClassA(pathToInf,&classGuid,className,sizeof(className),(PDWORD)0)) {
return std::string("SetupDiGetINFClassA() failed -- unable to read zttap driver INF file");
}
@@ -269,9 +269,9 @@ std::string WindowsEthernetTap::addNewPersistentTapDevice(const char *pathToInf,
std::string WindowsEthernetTap::destroyAllLegacyPersistentTapDevices()
{
- char subkeyName[4096];
- char subkeyClass[4096];
- char data[4096];
+ char subkeyName[1024];
+ char subkeyClass[1024];
+ char data[1024];
std::set<std::string> instanceIdPathsToRemove;
{
@@ -321,9 +321,9 @@ std::string WindowsEthernetTap::destroyAllLegacyPersistentTapDevices()
std::string WindowsEthernetTap::destroyAllPersistentTapDevices()
{
- char subkeyName[4096];
- char subkeyClass[4096];
- char data[4096];
+ char subkeyName[1024];
+ char subkeyClass[1024];
+ char data[1024];
std::set<std::string> instanceIdPathsToRemove;
{
@@ -479,9 +479,9 @@ WindowsEthernetTap::WindowsEthernetTap(
_initialized(false),
_enabled(true)
{
- char subkeyName[4096];
- char subkeyClass[4096];
- char data[4096];
+ char subkeyName[1024];
+ char subkeyClass[1024];
+ char data[1024];
char tag[24];
std::string mySubkeyName;