Sorry, I can't duplicate your error. I can run your memset statement repeatedly with no problems.
The only warning I have is if you memset anything other than 0 to a length of sizeof(szTempBuf), you overwrite the terminating null. So then you'd no longer have a null terminating string (not an 'sz' in your prefixing nominclature). You could still use szTempBuf as an array of char, but it wouldn't be a string. If you want to memset anything other than 0, try sizeof(szTempBuf)-1.
But even if I intentionally overwrite the terminating null, I don't get an out of bounds error. I get other errors when I try to use szTempBuf as a string, but I get no errors on memset.
Could you post a bigger chunk of your code?