mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +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);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user