harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r693423 - /harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp
Date Tue, 09 Sep 2008 10:34:34 GMT
Author: hindessm
Date: Tue Sep  9 03:34:34 2008
New Revision: 693423

URL: http://svn.apache.org/viewvc?rev=693423&view=rev
Log:
Make sure we have a terminting '\0' in buf.

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp?rev=693423&r1=693422&r2=693423&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp Tue Sep  9 03:34:34 2008
@@ -125,7 +125,8 @@
 #ifdef PLATFORM_POSIX
     static const char self_path[] = "/proc/self/exe";
     // Resolve full path to module
-    if (readlink(self_path, buf, sizeof(buf)) < 0) {
+    memset(buf, 0, sizeof(buf));
+    if (readlink(self_path, buf, sizeof(buf)-1) < 0) {
 #else
     if (!GetModuleFileName(NULL, buf, sizeof(buf))) {
 #endif



Mime
View raw message