mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
Both readlink args should not point to the same buffer
This commit is contained in:
parent
daa78d7749
commit
e1e63b89f4
@ -123,9 +123,10 @@ ZEND_API int zend_gdb_present(void)
|
|||||||
}
|
}
|
||||||
pid = atoi(s);
|
pid = atoi(s);
|
||||||
if (pid) {
|
if (pid) {
|
||||||
|
char out[1024];
|
||||||
sprintf(buf, "/proc/%d/exe", (int)pid);
|
sprintf(buf, "/proc/%d/exe", (int)pid);
|
||||||
if (readlink(buf, buf, sizeof(buf) - 1) > 0) {
|
if (readlink(buf, out, sizeof(out) - 1) > 0) {
|
||||||
if (strstr(buf, "gdb")) {
|
if (strstr(out, "gdb")) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user