Description: when a program is compiled with -D_FORTIFY_SOURCE=2, the vsprintf_chk function is called to handle sprintf/snprintf, but it needlessly pretruncates the destination which changes the results of sprintf(foo, "%sbar", baz). Bug: http://sourceware.org/bugzilla/show_bug.cgi?id=7075 Bug-Ubuntu: https://launchpad.net/bugs/305901 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563637 Author: Kees Cook Index: glibc-2.9/debug/vsprintf_chk.c =================================================================== --- glibc-2.9.orig/debug/vsprintf_chk.c 2008-12-23 21:30:07.000000000 -0800 +++ glibc-2.9/debug/vsprintf_chk.c 2008-12-23 21:30:19.000000000 -0800 @@ -76,7 +76,6 @@ _IO_no_init (&f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL); _IO_JUMPS (&f._sbf) = &_IO_str_chk_jumps; - s[0] = '\0'; _IO_str_init_static_internal (&f, s, slen - 1, s); /* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n