@@ -196,9 +196,9 @@ void AddAllCPUID(CSHA512& hasher)
196
196
// Iterate over all standard leaves
197
197
AddCPUID (hasher, 0 , 0 , ax, bx, cx, dx); // Returns max leaf in ax
198
198
uint32_t max = ax;
199
- for (uint32_t leaf = 1 ; leaf <= max; ++leaf) {
199
+ for (uint32_t leaf = 1 ; leaf <= max && leaf <= 0xFF ; ++leaf) {
200
200
uint32_t maxsub = 0 ;
201
- for (uint32_t subleaf = 0 ;; ++subleaf) {
201
+ for (uint32_t subleaf = 0 ; subleaf <= 0xFF ; ++subleaf) {
202
202
AddCPUID (hasher, leaf, subleaf, ax, bx, cx, dx);
203
203
// Iterate subleafs for leaf values 4, 7, 11, 13
204
204
if (leaf == 4 ) {
@@ -219,7 +219,7 @@ void AddAllCPUID(CSHA512& hasher)
219
219
// Iterate over all extended leaves
220
220
AddCPUID (hasher, 0x80000000 , 0 , ax, bx, cx, dx); // Returns max extended leaf in ax
221
221
uint32_t ext_max = ax;
222
- for (uint32_t leaf = 0x80000001 ; leaf <= ext_max; ++leaf) {
222
+ for (uint32_t leaf = 0x80000001 ; leaf <= ext_max && leaf <= 0x800000FF ; ++leaf) {
223
223
AddCPUID (hasher, leaf, 0 , ax, bx, cx, dx);
224
224
}
225
225
}
0 commit comments