You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doesn't seem to support %.* as a format specifier, yet there are a few examples in the code? @addaleax?
Currently the % eats the length specifier then the second argument triggers the CHECK_NOT_NULL
@mmomtchev Yeah, length specifiers make sense for a printf that is mainly intended to handle C strings, but it’s not important for a type-aware C++ variant like the one that we have. I think it would be just fine here to replace Debug(session, "Error '%.*s'", len, message); with Debug(session, "Error '%s'", std::string(message, len));.
Yes, in fact, there are 3 different sprintfs used through out the code: this one, from debug_utils-inl.h, the V8 one and the OS-provided one - and all the other examples are for the other two which support it
Activity
mmomtchev commentedon Oct 16, 2020
node/src/debug_utils-inl.h
Line 80 in 7f25fe8
%.*as a format specifier, yet there are a few examples in the code? @addaleax?Currently the
%eats the length specifier then the second argument triggers theCHECK_NOT_NULL[-]Segfault with NODE_DEBUG_NATIVE=HTTP2SESSION[/-][+]%.* is not a supported debug specifier[/+]addaleax commentedon Oct 17, 2020
@mmomtchev Yeah, length specifiers make sense for a printf that is mainly intended to handle C strings, but it’s not important for a type-aware C++ variant like the one that we have. I think it would be just fine here to replace
Debug(session, "Error '%.*s'", len, message);withDebug(session, "Error '%s'", std::string(message, len));.mmomtchev commentedon Oct 17, 2020
Yes, in fact, there are 3 different
sprintfs used through out the code: this one, fromdebug_utils-inl.h, the V8 one and the OS-provided one - and all the other examples are for the other two which support ithttp2: remove unsupported %.* specifier
http2: remove unsupported %.* specifier
http2: remove unsupported %.* specifier
http2: remove unsupported %.* specifier
http2: remove unsupported %.* specifier