Buffalo man sentenced to 12 years in prison for attempted mu