51Degrees / common-cxx

A shared functionality library that is used by 51Degrees products
Other
0 stars 6 forks source link

Add `%s` to relevant status code messages. #38

Closed drasmart closed 5 months ago

drasmart commented 8 months ago

Why

justadreamer commented 6 months ago

@drasmart could you please confirm if the on the other end sprintf always provides this string as a %s parameter - so we don't end up crashing. Thanks.

drasmart commented 5 months ago

fileName is always passed into Snprintf. If the format contains %s, the additional memory is allocated. see https://github.com/51Degrees/common-cxx/blob/main/status.c#L140-L149 (frozen^)

If fileName passed into the function was NULL, it gets assigned "null" value. see https://github.com/51Degrees/common-cxx/blob/main/status.c#L133-L135 (frozen^)