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