<p>Neels Hofmeyr <strong>uploaded patch set #4</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/12716">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo_fsm_inst_state_chg(): clamp timeout_secs to <= ~68 years<br><br>During testing of the upcoming tdef API, it became apparent that passing very<br>large timeout values to osmo_fsm_inst_state_chg() wraps back in the number<br>range, and might actually result in effectively very short timeouts instead.<br><br>Since time_t's range is not well defined across platforms, use a reasonable<br>maximum value of signed 32 bit integer. Hence this will be safe at least on<br>systems with an int32_t for struct timeval.tv_sec and larger.<br><br>Clamp the osmo_fsm_inst_state_chg() timeout_secs argument to a maximum of<br>0x7fffffff, which amounts to just above 68 years:<br>float(0x7fffffff) / (60. * 60 * 24 * 365.25) = 68.04965038532715<br><br>(In upcoming patch Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5, this can be<br>verified to work by invoking tdef_test manually with a cmdline argument passed<br>to enable the range check.)<br><br>Change-Id: I35ec4654467b1d6040c8aa215049766089e5e64a<br>---<br>M src/fsm.c<br>1 file changed, 13 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/16/12716/4</pre><p>To view, visit <a href="https://gerrit.osmocom.org/12716">change 12716</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/12716"/><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: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: I35ec4654467b1d6040c8aa215049766089e5e64a </div>
<div style="display:none"> Gerrit-Change-Number: 12716 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-CC: Harald Welte <laforge@gnumonks.org> </div>