https://osmocom.org/https://osmocom.org/favicon.ico?16647414092020-02-04T21:30:41ZOpen Source Mobile Communicationslibosmocore - Bug #4388: bitvec: bitvec_read_field() can never return negative value on errorhttps://osmocom.org/issues/4388?journal_id=173892020-02-04T21:30:41Zfixeria
<ul><li><strong>Priority</strong> changed from <i>Normal</i> to <i>High</i></li></ul><p>Not sure how we're supposed to fix this problem. Changing the type of return value to 'int' does not seem to be a good solution. Most likely, we would have to deprecate this function in favor of a new one... or even multiple functions like bitvec_read_u8(), bitvec_read_u16(), bitvec_read_u32() and bitvec_read_u64().</p> libosmocore - Bug #4388: bitvec: bitvec_read_field() can never return negative value on errorhttps://osmocom.org/issues/4388?journal_id=174912020-02-18T23:02:02Zfixeria
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>10</i></li></ul><p>Unit test demonstrating the problem: <a class="external" href="https://gerrit.osmocom.org/c/libosmocore/+/17220">https://gerrit.osmocom.org/c/libosmocore/+/17220</a>.</p> libosmocore - Bug #4388: bitvec: bitvec_read_field() can never return negative value on errorhttps://osmocom.org/issues/4388?journal_id=230362021-11-16T15:08:32Zlaforge
<ul><li><strong>Assignee</strong> set to <i>fixeria</i></li></ul> libosmocore - Bug #4388: bitvec: bitvec_read_field() can never return negative value on errorhttps://osmocom.org/issues/4388?journal_id=230402021-11-17T03:41:41Zfixeria
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>% Done</strong> changed from <i>10</i> to <i>80</i></li></ul><p>I came up with an idea to use errno in order to indicate errors:</p>
<p><a class="external" href="https://gerrit.osmocom.org/c/libosmocore/+/26307">https://gerrit.osmocom.org/c/libosmocore/+/26307</a> bitvec_read_field(): indicate errors using errno [NEW]</p>
<p>so there is no need to deprecate this function. While working on it, I found and fixed some additional problems:</p>
<p><a class="external" href="https://gerrit.osmocom.org/c/libosmocore/+/26308">https://gerrit.osmocom.org/c/libosmocore/+/26308</a> bitvec_read_field(): fix incorrect bit-shift issue found by UBSan [NEW]<br /><a class="external" href="https://gerrit.osmocom.org/c/libosmocore/+/26309">https://gerrit.osmocom.org/c/libosmocore/+/26309</a> bitvec_read_field(): optimize by expanding bytenum_from_bitnum() [NEW]<br /><a class="external" href="https://gerrit.osmocom.org/c/libosmocore/+/26310">https://gerrit.osmocom.org/c/libosmocore/+/26310</a> tests/testsuite.at: ensure empty stderr for the bitvec_test [NEW]</p> libosmocore - Bug #4388: bitvec: bitvec_read_field() can never return negative value on errorhttps://osmocom.org/issues/4388?journal_id=230582021-11-18T13:12:07Zfixeria
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>80</i> to <i>100</i></li></ul><p>All patches have been merged.</p>