<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/14432">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">logging: Check return error from time() call<br><br>Related: OS#4055<br>Change-Id: Ief155a76169426a677256e09d3e91751c4e2529f<br>---<br>M src/logging.c<br>1 file changed, 2 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/14432/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/logging.c b/src/logging.c</span><br><span>index b8960f9..f8dfd5a 100644</span><br><span>--- a/src/logging.c</span><br><span>+++ b/src/logging.c</span><br><span>@@ -362,7 +362,8 @@</span><br><span>                  /* man ctime: user-supplied buffer should have room for at least 26 bytes */</span><br><span>                         char ctime_buf[26];</span><br><span>                  time_t tm;</span><br><span style="color: hsl(0, 100%, 40%);">-                      tm = time(NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+                      if ((tm = time(NULL)) == (time_t) -1)</span><br><span style="color: hsl(120, 100%, 40%);">+                         goto err;</span><br><span>                    if (!ctime_r(&tm, ctime_buf))</span><br><span>                            goto err;</span><br><span>                    /* Remove new line char atthe end added by ctime */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/14432">change 14432</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/+/14432"/><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: Ief155a76169426a677256e09d3e91751c4e2529f </div>
<div style="display:none"> Gerrit-Change-Number: 14432 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>