A purchaser at a void or irregular judicial sale under foreclosure of a mortgage succeeds to all of the interests of the mortgagee.