Repository navigation
[#691] Fix stack overflow in test_connection_bind_unix_socket - #692
Conversation
|
@jesperpedersen PTAL |
Pranav-error
left a comment
There was a problem hiding this comment.
Looks good. struct configuration is about 26.7 MB here (sizeof on this PR's headers, macOS arm64), well above the default 8 MB stack, so moving it to the heap is the right fix. These two tests were the only places that put it on the stack; the other copy in tscommon.c is static.
One small thing, not blocking: in test_connection_bind_unix_socket_permissions, if calloc fails we go to cleanup before sock_path is set, so unlink(sock_path) reads an uninitialized buffer. The mkdtemp failure path already had the same problem. Moving the memset(sock_path, ...) to the top of the test fixes both.
205e30f to
5f01c2f
Compare
@Pranav-error Good catch. Moved it to the top. PTAL |
|
Re-checked at 5f01c2f: |
Allocated
test_configon the heap and addedfree(test_config)in cleanupCloses #691