symisc / PH7

An Embedded Implementation of PHP (C Library)
http://ph7.symisc.net
Other
493 stars 68 forks source link

Stack addresses (source) may be assigned to non-local variables #37

Open szsam opened 1 year ago

szsam commented 1 year ago

https://github.com/symisc/PH7/blob/c9cde8652331559a3e470b42d9705a56f73aaa31/ph7.c#L38377-L38392 The address of local variable result is assigned to non-local variables pA->pNext and pB->pNext. Storing the address of a local variable in non-local memory can cause a dangling pointer bug if the address is used after the function returns.