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.
if (!buf_strv)
return -ENOMEM;
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;
}
strscpyl((char *)buf_nulstr + nulstr_len, len + 1, prop, "=", val, NULL);
nulstr_len += len + 1;
}