The __sflush function in fflush.c in stdio in libc in FreeBSD 10.1 and the kernel in Apple iOS before 9 mishandles failures of the write system call, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (heap-based buffer overflow) via a crafted application.
https://www.freebsd.org/security/advisories/FreeBSD-SA-14:27.stdio.asc
https://svnweb.freebsd.org/base?view=revision&revision=275665
https://support.apple.com/HT205267
https://support.apple.com/HT205212
http://lists.apple.com/archives/security-announce/2015/Sep/msg00008.html
http://lists.apple.com/archives/security-announce/2015/Sep/msg00001.html