So here I believe I have a small buffer overflow problem I found when reviewing someone else\'s code. It immediately struck me as incorrect, and potentially dangerous, but a
Correct statement. Since you are passing address of the second character of the string to strlen(), you are getting the length one character less as a result. Aside from that, the main problem is with sprintf(), that's one of the reasons that it's not safe.
Even this compiles and executes (may also crash).
char* x = new char;
sprintf(x, "This is way longer than one character");
printf("%s", x);
In order to avoid this dangerous issue, you should use safe versions of this function like snprintf() or asprintf() under GCC or sprintf_s() under MSVC.
As references, please have a look at The GNU C Library documentation in this regard and also security note of MSDN's sprintf() article.