Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix how ovis_json:json_dict_build() use va_arg() #1621

Closed
wants to merge 1 commit into from

Conversation

nichamon
Copy link
Collaborator

Before the change, json_dict_build() recursively calls functions to create a dictionary. It passes a va_list object to the nested function. The function calls va_arg(). According to the va_arg man page, after the function returns, the va_list object is undefined.

The patch passes a va_list pointer to its nested function, so the va_list properly moves when the inner function calls va_arg().

Before the change, json_dict_build() recursively calls functions to
create a dictionary. It passes a va_list object to the nested function.
The function calls va_arg(). According to the va_arg man page, after the
function returns, the va_list object is undefined.

The patch passes a va_list pointer to its nested function, so the
va_list properly moves when the inner function calls va_arg().
@nichamon nichamon requested a review from tom95858 February 27, 2025 19:39
@nichamon
Copy link
Collaborator Author

@tom95858 Please close this pull request if you have already incorporated the change in your branch.

@tom95858
Copy link
Collaborator

@nichamon, this has been pulled into the multi-instance-wip branch.

@tom95858 tom95858 closed this Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants