Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions phpthread.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func (thread *phpThread) getActiveRequest() *http.Request {
// Pin a string that is not null-terminated
// PHP's zend_string may contain null-bytes
func (thread *phpThread) pinString(s string) *C.char {
if s == "" {
return nil
}

sData := unsafe.StringData(s)
thread.Pin(sData)
return (*C.char)(unsafe.Pointer(sData))
Expand Down