]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Use snprintf() instead of sprintf()
authorBart Van Assche <bvanassche@acm.org>
Fri, 28 Oct 2011 15:05:50 +0000 (15:05 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 28 Oct 2011 15:05:50 +0000 (15:05 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12249

coregrind/m_debuginfo/debuginfo.c

index 4096d5c7d40c6b7ed03f7d752ec2c11c3320b820..7bd431172bcd160d2b0eadfaf3a31176a2c666bd 100644 (file)
@@ -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;