You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2008/09/09 12:34:34 UTC
svn commit: r693423 -
/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp
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