How to keep baby from sticking legs thru crib rails

I heard you can’t have bumpers In Cribs because of suffocation. so how do you keep your baby from sticking their body parts through the spaces in between the bars? I’m afraid he’s going to hurt himself or get stuck. He moves around a lot at night.