Although it looks uncomfortable to our adult eyes, it's actually very comfortable for toddlers to ride in a rear-facing car seat. As you know, little ones can contort themselves into all sorts of positions that would cause serious pain for adults. Propping legs up on a seat or hanging them over the side of a car seat is minor in comparison. More importantly, though, it is safe for baby's legs to touch the vehicle seat when riding in a rear-facing car seat.
It may seem that staying in the rear-facing car seat might put baby at risk of broken legs in a crash. However, staying rear-facing provides a great deal more protection for the head, neck and spine in a crash, and in any crash severe enough to cause broken legs, there would also be great potential for head, neck and spine injuries. So it's a matter of choosing to protect the most important parts. It's much easier to fix a broken leg than a broken neck, for example. At one car seat safety event I attended, one speaker mentioned that broken legs are actually a fairly common injury for children in forward-facing car seats and boosters, so the worry over broken legs while rear-facing may be misplaced all-around.
A common misconception is that babies outgrow their infant car seats when their legs are hanging over the edge and their feet can touch the vehicle seat. The position of baby's legs does not matter. You'll know that your baby has outgrown the infant car seat when there is less than an inch of hard shell over the top of baby's head, or when your baby exceeds the maximum weight of the car seat. You should also check the instruction book to see if there are any other size recommendations specific to your baby's car seat.
For older babies and toddlers whose legs are overhanging the rear-facing car seat, they can sit cross-legged, put their legs over the sides of the car seat, or prop them up on the vehicle seat.