diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2015-06-01 11:32:39 +0200 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2015-06-01 12:04:37 +0200 |
commit | d854ba50a82f28b776c670d27156f0e9881fde8a (patch) | |
tree | 9d33921ac92399c15fc79feb43899eeb21bd7082 /src/libsystemd/sd-id128 | |
parent | 19672f1e5fd23ec3ea5b93b8268ae07f2b8e9645 (diff) |
sd-device: fix invalid property strv pointers
In device_update_properties_bufs(), the strv is built from pointers into the
single nul-terminated buf_nulstr string, to avoid allocating the key=value
strings twice. However, we must not do that while building and
GREEDY_REALLOC0()'ing buf_nulstr, as each time when this actually reallocates
memory the pointers we wrote into buf_strv so far become invalid.
So change the logic to first completely build the new buf_nulstr, and then
iterate over it to pick out the pointers to the individual key=value strings
for properties_strv.
This fixes invalid environment for udev callouts.
Diffstat (limited to 'src/libsystemd/sd-id128')
0 files changed, 0 insertions, 0 deletions