-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-security
Milestone
Description
The return value of OS::SNPrint (which boils down to vsnprintf) is always assumed to contain the number of bytes occupied by formatted output, whereas it can sometimes contain a negative value (typically -1) due to an error condition. Example (dart/runtime/lib/isolate.cc, function BuildIsolateName):
const char* kFormat = "%s/%s.%s";
intptr_t len = OS::SNPrint(NULL, 0, kFormat, script_name, class_name,
func_name) + 1;
char* chars = reinterpret_cast<char*>(
Isolate::Current()->current_zone()->Allocate(len));
OS::SNPrint(chars, len, kFormat, script_name, class_name, func_name);
return chars;
Metadata
Metadata
Assignees
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-security