<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17110">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">exec: prevent uninitialized memory access in osmo_system_nowait()<br><br>If (!env_whitelist && addl_env), osmo_environment_append() would<br>access uninitialized memory. If both are false, execle() would<br>also deal with garbage values. Let's ensure that at least the<br>first element of new_env[] is initialized.<br><br>Change-Id: Id3901de4692ef44e9e9c67b1804e027fc4ce7c18<br>Fixes: CID#206571<br>---<br>M src/exec.c<br>1 file changed, 3 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/17110/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/exec.c b/src/exec.c</span><br><span>index a9d8ce0..b806ad5 100644</span><br><span>--- a/src/exec.c</span><br><span>+++ b/src/exec.c</span><br><span>@@ -217,6 +217,9 @@</span><br><span>              /* close all file descriptors above stdio */</span><br><span>                 osmo_close_all_fds_above(2);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+              /* man execle: "an array of pointers *must* be terminated by a null pointer" */</span><br><span style="color: hsl(120, 100%, 40%);">+             new_env[0] = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>                 /* build the new environment */</span><br><span>              if (env_whitelist)</span><br><span>                   osmo_environment_filter(new_env, ARRAY_SIZE(new_env), environ, env_whitelist);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/17110">change 17110</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/17110"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Id3901de4692ef44e9e9c67b1804e027fc4ce7c18 </div>
<div style="display:none"> Gerrit-Change-Number: 17110 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>