Skip to content

Commit e1e63b8

Browse files
David Carliernikic
David Carlier
authored andcommitted
Both readlink args should not point to the same buffer
1 parent daa78d7 commit e1e63b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Zend/zend_gdb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ ZEND_API int zend_gdb_present(void)
123123
}
124124
pid = atoi(s);
125125
if (pid) {
126+
char out[1024];
126127
sprintf(buf, "/proc/%d/exe", (int)pid);
127-
if (readlink(buf, buf, sizeof(buf) - 1) > 0) {
128-
if (strstr(buf, "gdb")) {
128+
if (readlink(buf, out, sizeof(out) - 1) > 0) {
129+
if (strstr(out, "gdb")) {
129130
ret = 1;
130131
}
131132
}

0 commit comments

Comments
 (0)