Fix index calculation for /proc/[pid]/cmdline.
Fix index calculation for /proc/[pid]/cmdline.

We were truncating buf using a index relative to the middle of the slice (i.e.
where envv begins), but we need to calculate the index relative to the entire
slice.

Updates #2923.

PiperOrigin-RevId: 319154950

google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor