From: Bart Van Assche Date: Fri, 28 Oct 2011 15:05:50 +0000 (+0000) Subject: Use snprintf() instead of sprintf() X-Git-Tag: svn/VALGRIND_3_8_0~599 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94dfb3ba44cbfd3264ef59ec8455ca427af97980;p=thirdparty%2Fvalgrind.git Use snprintf() instead of sprintf() git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12249 --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 4096d5c7d4..7bd431172b 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -1100,8 +1100,8 @@ void VG_(di_notify_pdb_debuginfo)( Int fd_obj, Addr avma_obj, */ Int mashedSzB = VG_(strlen)(pdbname) + VG_(strlen)(wpfx) + 50/*misc*/; HChar* mashed = ML_(dinfo_zalloc)("di.debuginfo.dnpdi.1", mashedSzB); - VG_(sprintf)(mashed, "%s/drive_%c%s", - wpfx, pdbname[0], &pdbname[2]); + VG_(snprintf)(mashed, mashedSzB, "%s/drive_%c%s", + wpfx, pdbname[0], &pdbname[2]); vg_assert(mashed[mashedSzB-1] == 0); ML_(dinfo_free)(pdbname); pdbname = mashed; @@ -1112,8 +1112,8 @@ void VG_(di_notify_pdb_debuginfo)( Int fd_obj, Addr avma_obj, */ Int mashedSzB = VG_(strlen)(pdbname) + VG_(strlen)(home) + 50/*misc*/; HChar* mashed = ML_(dinfo_zalloc)("di.debuginfo.dnpdi.2", mashedSzB); - VG_(sprintf)(mashed, "%s/.wine/drive_%c%s", - home, pdbname[0], &pdbname[2]); + VG_(snprintf)(mashed, mashedSzB, "%s/.wine/drive_%c%s", + home, pdbname[0], &pdbname[2]); vg_assert(mashed[mashedSzB-1] == 0); ML_(dinfo_free)(pdbname); pdbname = mashed;