In theory, canned food never goes bad. Sure, you have expiration and “best by” dates but canned food which is sterilized inside a sealed container simply doesn’t have anything to decompose it. This is why canned food has been opened several decades beyond its expiration date and while taste wasn’t as good and some of the nutritional value was lost, it was still very much edible.
Now that’s theory and it does apply but as we know sometimes things just don’t work out as well.
Today my wife was opening a can of chopped tomatoes and as soon as the can was pierced the contents burst out in all directions. While there was no swelling, pressure had clearly built up inside, a clear sign of decomposition. The food inside didn’t smell awfully bad, but it didn’t smell good either. In this case, the risk of bacteria means the food should be thrown away and anything that was in contact with the juice from inside the can must be cleaned properly. In this case, since there were no leaks, what probably happened was that the chopped tomato wasn’t fully sterilized and some bacteria was still alive inside when the can was sealed.
A can that is bulged, a swelled can, a can that “explodes” when open, a can that leaks or smells bad when open should be discarded. Other than that, even past the expiration date canned food is good to go. Just keep these things in mind so as to be safe.