_strupr is writing to a read-only buffer.
It should only write when there is an actual modification (in the C locale), see ThFabba's comment for more details.