waku-org / nwaku

Waku node and protocol.
Other
201 stars 53 forks source link

fix: segfault for libwaku's empty response messages #3108

Closed gabrielmer closed 1 month ago

gabrielmer commented 1 month ago

Description

Whenever we called callback(RET_OK, unsafeAddr msg[0], cast[csize_t](len(msg)), userData) with msg being an empty string, we got a segfault.

Changed de data type of msg to cstring instead of nim strings, which fixes the segfault.

Additionally, fixed the usage of foreignThreadGc and added usage of handleRes in missing parts

Changes

Issue

3039

github-actions[bot] commented 1 month ago

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3108

Built from 7933fd1f896b3678149f6def38916d6c6c501558