respondchat / c-go-interop

POC repo for examining calling go code from c++
https://xnacly.me/posts/2024/go-cpp-interop/
2 stars 0 forks source link

lib: check for error http.Get #2

Closed xNaCly closed 2 days ago

xNaCly commented 2 days ago

this commit introduces error handling for the http.Get call in lib.Request, therefore mitigating the possiblity of null pointer dereferences when accessing the (*Response).StatusCode field.

See https://pkg.go.dev/net/http#Get and https://pkg.go.dev/net/http#Response

Thanks to @raphael10-collab for reporting this bug, see: https://github.com/respondchat/c-go-interop/issues/1