summaryrefslogtreecommitdiff
path: root/Zend/zend_gdb.c
diff options
context:
space:
mode:
authorDavid Carlier <dcarlier@afilias.info>2019-04-15 09:03:11 +0000
committerNikita Popov <nikita.ppv@gmail.com>2019-04-15 15:55:00 +0200
commite1e63b89f41d41f6fd5ab8e7463d9bb6ac63369c (patch)
treedd61e5d6499112e437869662c24f9be63aa9d682 /Zend/zend_gdb.c
parentdaa78d7749c0b9fa6f622a94defc5e687e5727e0 (diff)
downloadphp-git-e1e63b89f41d41f6fd5ab8e7463d9bb6ac63369c.tar.gz
Both readlink args should not point to the same buffer
Diffstat (limited to 'Zend/zend_gdb.c')
-rw-r--r--Zend/zend_gdb.c5
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;
}
}