mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Both readlink args should not point to the same buffer
This commit is contained in:
parent
daa78d7749
commit
e1e63b89f4
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue