tyk icon indicating copy to clipboard operation
tyk copied to clipboard

Fix invalid memory address or nil pointer dereference in Golang Virtual Endpoints

Open uddmorningsun opened this issue 2 years ago • 2 comments

[Jul 20 14:23:42] DEBUG Started api_id=1 api_name=Tyk Test API mw=GoPluginMiddleware: : org_id=default origin=172.17.0.1 path=/tyk-api-test/foo ts=1658327022041894229
[Jul 20 14:23:42] DEBUG Go-plugin request processing took ms=0.010736 mwPath=123321/plugin.so mwSymbolName=GoPluginFoo
[Jul 20 14:23:42] ERROR Recovered from panic while running Go-plugin middleware func error=runtime error: invalid memory address or nil pointer dereference mwPath=123321/plugin.so mwSymbolName=GoPluginFoo
[Jul 20 14:23:42] DEBUG Finished api_id=1 api_name=Tyk Test API code=500 error=runtime error: invalid memory address or nil pointer dereference mw=GoPluginMiddleware: : ns=95692 org_id=default origin=172.17.0.1 path=/tyk-api-test/foo

Signed-off-by: Chenyang Yan [email protected]

Description

Fix invalid memory address or nil pointer dereference in Golang Virtual Endpoints

Related Issue

#4197

How This Has Been Tested

See log message and do not produce panic error

uddmorningsun avatar Jul 20 '22 15:07 uddmorningsun

I'd suggest introducing a new local variable successHandler as already done with logger and handler. Else you modify the shared GoPluginMiddleware on every call there.

PatrickTaibel avatar Jul 29 '22 08:07 PatrickTaibel

I'd suggest introducing a new local variable successHandler as already done with logger and handler

Good idea, I will update it

uddmorningsun avatar Jul 29 '22 09:07 uddmorningsun

@uddmorningsun thanks for the contribution. We're logging this PR internally and planning it for the next patch releases!

lghiur avatar Nov 25 '22 11:11 lghiur

I found Update branch/Update with rebase will contains other commit to review for github (force-pushed the master branch from 2f049e6 to 7e0e11c), it's not my expected rebase result...😅https://github.blog/changelog/2022-02-03-more-ways-to-keep-your-pull-request-branch-up-to-date/ Sorry to bother your review, I have rebased manual with command line

uddmorningsun avatar Feb 02 '23 13:02 uddmorningsun

Waiting for this fix

tomshy avatar Oct 01 '23 19:10 tomshy