Candy canes do eventually go bad within 12 to 14 months of purchase date.
However although candy canes do go bad and candy canes do expire the candy canes are still safe to eat after they expire and go bad.
The candy cane when it goes bad just basically goes stale and may not have as good of a taste to it as it would if fresh.
But candy canes don't go bad as to where they will poison you if you eat it.
So yes candy canes go bad after a certain amount of time just like other hard candies go bad and stale but even when the candy canes or other hard candies go bad they remain safe to eat.
The candy cane or other hard candies may not be as good to eat or enjoyable to eat but you won't get sick from eating old candy canes or even eating older hard candy.
I've eaten candy canes that were 10 years old before and they were still safe to eat.