Skip to content

Conversation

@djberg96
Copy link

@djberg96 djberg96 commented Sep 8, 2025

The rugged_rb_ary_to_strarray function uses xmalloc to allocate memory for str_array->strings, but there are several cases where this memory might not be allocated:

If rb_array is NIL_P, the function returns early with strings = NULL. If there's an empty array, the count would be 0. However, in the cleanup sections, the code unconditionally calls xfree(custom_headers.strings) without checking if it's NULL. This can cause "munmap_chunk(): invalid pointer" errors.

Should fix #859

@djberg96
Copy link
Author

@carlosmn Look ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants