<p>Harald Welte has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12998">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">select: Call log_reset_context() before calling file descriptor callbacks<br><br>Make sure to clear any log context before processing the next incoming message<br>as part of some file descriptor callback.  This effectively prevents "context<br>leaking" from processing of one message into processing of the next message as part<br>of one iteration through the list of file descriptors here.<br><br>Change-Id: I3644c7bc1a9cec5858eb0faf94efc8c3ba7f5d8d<br>Closes: OS#3813<br>---<br>M src/select.c<br>1 file changed, 6 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/98/12998/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/select.c b/src/select.c</span><br><span>index b594ca5..4e7be35 100644</span><br><span>--- a/src/select.c</span><br><span>+++ b/src/select.c</span><br><span>@@ -35,6 +35,7 @@</span><br><span> #include <osmocom/core/select.h></span><br><span> #include <osmocom/core/linuxlist.h></span><br><span> #include <osmocom/core/timer.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/core/logging.h></span><br><span> </span><br><span> #include "../config.h"</span><br><span> </span><br><span>@@ -214,6 +215,11 @@</span><br><span> </span><br><span>                 if (flags) {</span><br><span>                         work = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+                     /* make sure to clear any log context before processing the next incoming message</span><br><span style="color: hsl(120, 100%, 40%);">+                      * as part of some file descriptor callback.  This effectively prevents "context</span><br><span style="color: hsl(120, 100%, 40%);">+                  * leaking" from processing of one message into processing of the next message as part</span><br><span style="color: hsl(120, 100%, 40%);">+                    * of one iteration through the list of file descriptors here.  See OS#3813 */</span><br><span style="color: hsl(120, 100%, 40%);">+                        log_reset_context();</span><br><span>                         ufd->cb(ufd, flags);</span><br><span>              }</span><br><span>            /* ugly, ugly hack. If more than one filedescriptor was</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12998">change 12998</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/12998"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I3644c7bc1a9cec5858eb0faf94efc8c3ba7f5d8d </div>
<div style="display:none"> Gerrit-Change-Number: 12998 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>