Strcpy is a great example where buffer overflows might occur. You need to pay attention to the size of the buffer you’re writing to, else you’re gonna damage other memory zones which will harm and expose vulnerabilities in your program. Well noticed!
You should take a look to a program called Valgrind (I think it’s only available for UNIX systems). It’s a memory management tool and it allows you to verify if you’re doing everything correct with the memory in your program ( It checks memory leaks, invalid frees, invalid writes, all that stuff!)