The init function in the ReseedField contract incorrectly uses an index increment intended for the outer loop (i++) within the inner loop (j++). This error leads to improper array indexing and potential out-of-bounds access issues.
The vulnerability lies in the following snippet of the init function:
This indexing error causes the inner loop (j) to not iterate correctly over accountPlots[i].plots, as intended. Instead, the outer loop (i) is incorrectly incremented again, potentially leading to:
Array Bounds Errors: Accessing elements out of the bounds of accountPlots and plots.
Data Corruption: Incorrect data assignment or unintended state mutations.
Contract Failures: Potential contract halts due to out-of-gas errors or inconsistent state.
Manual Code Review
Correct the inner loop index to j++ to ensure proper iteration over accountPlots[i].plots.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.