Use the right type for `len`, avoid segmentation fault
`getline()` requires its second parameter to be `size_t *`. On the amd64
platform the size of `unsigned int` is 4 and the size of `size_t` is 8
bytes. Using a wrong pointer type can lead to a stack variables
corruption (overwriting with zeros) and a segmentation fault later.
See also similar `len` declarations in `_discover_get_pci_raw_sys()` in
the docs and `_discover_get_ata_raw()` / `discover_get_pci_raw_proc()` /
`discover_get_usb_raw()` in the source code.
Here is the fix of the problem:
Use the right type for `len`, avoid segmentation fault
`getline()` requires its second parameter to be `size_t *`. On the amd64
platform the size of `unsigned int` is 4 and the size of `size_t` is 8
bytes. Using a wrong pointer type can lead to a stack variables
corruption (overwriting with zeros) and a segmentation fault later.
See also similar `len` declarations in `_discover_ get_pci_ raw_sys( )` in get_ata_ raw()` / `discover_ get_pci_ raw_proc( )` / get_usb_ raw()` in the source code.
the docs and `_discover_
`discover_