Browse Source

HPCC-8924 Prevent simple recursive computerTypes causing stack faults

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 12 năm trước cách đây
mục cha
commit
875eb4526e
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      common/environment/environment.cpp

+ 2 - 2
common/environment/environment.cpp

@@ -789,7 +789,7 @@ public:
             return os;
 
         Owned<IConstComputerTypeInfo> type = env->getComputerType(root->queryProp("@computerType"));
-        if (type)
+        if (type && (type.get() != this))
             return type->getOS();
         return MachineOsUnknown;
     }
@@ -800,7 +800,7 @@ public:
             return atoi(v);
 
         Owned<IConstComputerTypeInfo> type = env->getComputerType(root->queryProp("@computerType"));
-        if (type)
+        if (type && (type.get() != this))
             return type->getNicSpeedMbitSec();
         return 0;
     }