No sheriff shall become the purchaser either directly or indirectly of any property, real or personal, by the sheriff exposed to sale by virtue of any mortgage, judgment, execution, or other process; and all such purchases made by any sheriff, or any other person for the sheriff, shall be void.