File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/coreclr/hosts/corerun Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -455,7 +455,7 @@ namespace pal
455455#else // !__APPLE__
456456 // Use procfs to detect if there is a tracer process.
457457 // See https://www.kernel.org/doc/html/latest/filesystems/proc.html
458- char status[2048 ] = { 0 } ;
458+ char status[2048 ];
459459 int fd = ::open (" /proc/self/status" , O_RDONLY);
460460 if (fd == -1 )
461461 {
@@ -471,6 +471,8 @@ namespace pal
471471 {
472472 // We have data. At this point we can likely make a strong decision.
473473 const char tracer_pid_name[] = " TracerPid:" ;
474+ // null terminate status
475+ status[bytes_read] = ' \0 ' ;
474476 const char * tracer_pid_ptr = ::strstr (status, tracer_pid_name);
475477 if (tracer_pid_ptr == nullptr )
476478 return debugger_state_t ::not_attached;
You can’t perform that action at this time.
0 commit comments