Skip to content

Conversation

@mmelograno
Copy link
Contributor

PHP SDK

What did you accomplish?

How do we test the changes introduced in this PR?

Extra Notes

frazjp65 and others added 5 commits May 4, 2020 12:00
The `$cached_string` pulled out of the shared memory has trailing chars
that result in the string not being able to be decoded using
`json_decode`. This will never work unless the `$size` is the exact size
of the cached string.  Using `trim` fixes the issue.
The `shmop_write` function does not clear any existing data. If the
original data was longer than the new data, there will be trialing data
after the new data, causing the cache to be corrupt. Adding a null char
to use to mark then end of the string deals with this. If the new string
is longer, it will overwrite the existing null char.
Trim cached string before decoding
@sonarqube-pull-requests
Copy link

@mmelograno mmelograno merged commit 559eea4 into develop Apr 23, 2021
@mmelograno mmelograno deleted the fix/sharedMemory branch November 23, 2021 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants