sd-device: fix device_get_properties_strv()
A NULL pointer was inserted as the first element of the strv. This had the effect of always passing the empty environment to processes spawned by udev. Reported by Michał Bartoszkiewicz.
This commit is contained in:
@@ -659,7 +659,7 @@ static int device_update_properties_bufs(sd_device *device) {
|
||||
if (!buf_strv)
|
||||
return -ENOMEM;
|
||||
|
||||
buf_strv[++ strv_size] = (char *)&buf_nulstr[nulstr_len];
|
||||
buf_strv[strv_size ++] = (char *)&buf_nulstr[nulstr_len];
|
||||
strscpyl((char *)buf_nulstr + nulstr_len, len + 1, prop, "=", val, NULL);
|
||||
nulstr_len += len + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user