unikraft / kraftkit

Build and use highly customized and ultra-lightweight unikernel VMs.
https://unikraft.org/docs/cli
BSD 3-Clause "New" or "Revised" License
226 stars 62 forks source link

fix(run): Prevent possible nil-pointers by always using `Cut` #1600

Closed nderjung closed 5 months ago

nderjung commented 5 months ago

Prerequisite checklist

Description of changes

When parsing environmental variables in kraft run, which are often presented in circumstances with strings with an equals delimeter, the use of SplitN was not always checked for empty values. To prevent possible nil-pointers and to keep code consistent, replace all areas where this type of procedure occurs with strings.Cut instead.