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:
Tom Gundersen
2015-05-27 23:30:02 +02:00
parent 86c3bece38
commit 0e3e605613
+1 -1
View File
@@ -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;
}