forked from shirou/gopsutil

fix: add bounds check for /proc/[pid]/stat fields to prevent panic

fillFromTIDStatWithContext accesses fields up to index 22 without bounds checking. This causes an index-out-of-range panic when /proc/[pid]/stat has fewer than 23 fields, which can happen in container environments or with non-standard kernels. The function already guards fields[42] with a length check but is missing the same protection for lower-indexed fields. Fixes #2070


Author Yanhu007 Date Commit Parent 3aab859b
+3
1 changed file
+3
1 changed file