HMIProject / open62541-sys

2 stars 2 forks source link

Copy va_list args in vsnprintf() and add va_end() #10

Closed uklotzde closed 3 months ago

uklotzde commented 3 months ago

Prerequisite for https://github.com/HMIProject/open62541/pull/30.

uklotzde commented 3 months ago

I am not entirely happy that we are making an already unsafe function even unsafer by changing its behavior to not match the expectations while keeping the default name.1

But it gets the job done, and it is an undocumented internal function anyway, so that is okay for now.

Footnotes

1. Our `vsnprintf()` now behaves different from the default implementation. Fortunately, the difference is not directly related to safety because the worst that can happen is probably a memory leak and those are not considered unsafe (though undesirable). [↩](#user-content-fnref-1-6e9c8400ff7e6e3f7daa82e4364db60d)

Follow-up: #11