<p><a href="https://gerrit.osmocom.org/c/libosmocore/+/15265">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/15265/1//COMMIT_MSG">Commit Message:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/15265/1//COMMIT_MSG@11">Patch Set #1, Line 11:</a> <code style="font-family:monospace,monospace">segfaults: the vty->obuf is already NULL.</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Why do we try to send a message to a killed session first of all? That seems to be the route of the  […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I want to make sure that we cannot ever crash by writing to a NULL ofd. Whatever the reasons for the NULL ofd, and whatever the reasons for wanting to log to it.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Fixing the higher level fail would be: close down the logging target before taking down the ofd. I care about that only secondarily. This is only one cause for logging to NULL that we found now.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Fair enough, if we ensure closed telnets always close down log targets safely the issue would not exist, but I am not willing to verify that now. That is why I want these NULL checks at the buffer API level. It makes all other calling code bugs non-fatal in a trivial way, without the need to fully audit the ancient vty code.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Can we please get over this and not make a huge thing of it?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/15265/1//COMMIT_MSG@16">Patch Set #1, Line 16:</a> <code style="font-family:monospace,monospace">Also guard all buffer_*() functions against a NULL buffer argument, which</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">this looks like a hack to fix other parts of the code which may be wrong, and looks like it should b […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">If the calling code paths are not trivially clear, it is good practise to guard against NULL pointers. Rather drop a log line than crashing the entire program.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/15265/1//COMMIT_MSG@20">Patch Set #1, Line 20:</a> <code style="font-family:monospace,monospace">Related: OS#4164</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">This ticket doesn't look related to me.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">this one is correct, the one in the comment has a typo</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/15265/1/src/vty/vty.c">File src/vty/vty.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/15265/1/src/vty/vty.c@266">Patch Set #1, Line 266:</a> <code style="font-family:monospace,monospace">                    * of this same (killed) telnet session. See OS#4146. */</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">OS#4146 (https://osmocom. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">aha, the commit log has the correct one: #4164. Here there is a number swap. thx</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/15265">change 15265</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/+/15265"/><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: Idca3f54dc986abf6784790c12e69e02bdf77cb41 </div>
<div style="display:none"> Gerrit-Change-Number: 15265 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 27 Aug 2019 15:40:57 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>