diff options
-rw-r--r-- | Zend/zend_gdb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Zend/zend_gdb.c b/Zend/zend_gdb.c index 199589f5b8..0fff742048 100644 --- a/Zend/zend_gdb.c +++ b/Zend/zend_gdb.c @@ -123,9 +123,10 @@ ZEND_API int zend_gdb_present(void) } pid = atoi(s); if (pid) { + char out[1024]; sprintf(buf, "/proc/%d/exe", (int)pid); - if (readlink(buf, buf, sizeof(buf) - 1) > 0) { - if (strstr(buf, "gdb")) { + if (readlink(buf, out, sizeof(out) - 1) > 0) { + if (strstr(out, "gdb")) { ret = 1; } } |