reiabreu opened a new pull request, #9013: URL: https://github.com/apache/storm/pull/9013
`get_values()` returned the array from `extract_values_delim()` directly. Those entries point into the single buffer that `strtok_r` tokenizes in place, and `free_values()` then freed `values[0]` as if it were that buffer — which only holds when the first token starts at the buffer. - A value with a leading delimiter (e.g. `,a`) left `free_values` calling `free()` on an interior pointer → abort. - A value made up only of delimiters left `extract_values_delim` returning a non-NULL, non-NULL-terminated array (the terminator was only written when `size > 0`). The behaviour is pre-existing and reachable from any `get_values` caller (e.g. `banned.users`); it was raised on #9010 for the new `worker.launcher.oci.allowed.mount.source.dirs` key, and is split out here since it is not OCI-specific. Changes: - `get_values` copies the tokens into an independently owned, NULL-terminated array and frees the parsed buffer itself. - `free_values` frees each element and the array, and no longer dereferences a NULL argument before checking it. - `extract_values_delim` NULL-terminates the zero-token case. - Adds `test_get_values_degenerate` (leading, trailing, and delimiter-only values); it aborts on the pre-fix code. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
