From: Tom Gundersen Date: Wed, 27 May 2015 21:26:39 +0000 (+0200) Subject: sd-device: fix device_get_properties_strv() X-Git-Tag: v226.4~1^2~342 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=993e17947b005caa23636762683e0cf0afb2a600 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. --- diff --git a/src/libelogind/sd-device/device-private.c b/src/libelogind/sd-device/device-private.c index 3cadedbf4..10370af02 100644 --- a/src/libelogind/sd-device/device-private.c +++ b/src/libelogind/sd-device/device-private.c @@ -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; }