Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle.  http://sfsecurity.pr.erau.edu
Unsafe library function calls
A library is a collection of useful subroutines that a programmer can use in their program. 

The standard C library, which every C compiler has, has subroutines in it that can cause buffer overflows if not used properly. 

Programmers have to learn to use the library subroutines properly.  Unsafe library function calls are responsible for many vulnerabilities of all types.