aristanetworks / bst

A one-stop shop for process isolation
MIT License
99 stars 9 forks source link

misc: fix segfault with empty --init arg #22

Closed wwade closed 4 years ago

wwade commented 4 years ago

The "Program must be init of its pid namespace if no init is specified" test would sometimes fail with a segmentation fault, and it turns out the reason was that it would start searching backward for a / at opts.init memory, wanting to stop no earlier than opts.init itself, but it was starting one byte before, and so walked off into strange places!

Check if opts.init is an empty string and skip this search if it is.