1
0
Эх сурвалжийг харах

UI: Fix non-Windows vstrprintf

vsnprintf is called twice; one call must use args, and one must use
args2 (which is how it was supposed to be from the beginning). Each call
"consumes" its va_list parameter, so they each need to use a separate
copy. Fixes potential corruption and/or crashing when calling vsnprintf.
Jim 3 жил өмнө
parent
commit
646d47aacb

+ 1 - 1
UI/nix-update/nix-update-helpers.cpp

@@ -14,7 +14,7 @@ std::string vstrprintf(const char *format, va_list args)
 	std::string str;
 	int size = (int)vsnprintf(nullptr, 0, format, args2) + 1;
 	str.resize(size);
-	vsnprintf(&str[0], size, format, args2);
+	vsnprintf(&str[0], size, format, args);
 
 	va_end(args2);