chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b23f518
)
sd-device: fix device_get_properties_strv()
author
Tom Gundersen
<teg@jklm.no>
Wed, 27 May 2015 21:26:39 +0000
(23:26 +0200)
committer
Sven Eden
<yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:01:12 +0000
(10:01 +0100)
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.
src/libelogind/sd-device/device-private.c
patch
|
blob
|
history
diff --git
a/src/libelogind/sd-device/device-private.c
b/src/libelogind/sd-device/device-private.c
index 3cadedbf4a6e513ee106b7988e865c2ff23489ae..10370af029b5262b20f393dd8b7f402b0c10ff16 100644
(file)
--- 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;
}