DragonFlyBSD bugtracker: Issues
https://bugs.dragonflybsd.org/
https://bugs.dragonflybsd.org/favicon.ico?1629395208
2018-02-22T17:19:52Z
DragonFlyBSD bugtracker
Redmine
DragonFlyBSD - Bug #3123 (Closed): crypto/openssh/channels.c:3258: bad if statement ?
https://bugs.dragonflybsd.org/issues/3123
2018-02-22T17:19:52Z
dcb
<p>crypto/openssh/channels.c:3258]: (warning) The expression 'strcmp(listen_addr,"localhost") != 0' is suspicious. It overlaps 'strcmp(listen_addr,"127.0.0.1") == 0'.</p>
<p>Source code is</p>
<pre><code>} else if (strcmp(listen_addr, "localhost") != 0 ||<br /> strcmp(listen_addr, "127.0.0.1") 0 ||<br /> strcmp(listen_addr, "::1") 0) {</code></pre>
<p>maybe better code</p>
<pre><code>} else if (strcmp(listen_addr, "localhost") 0 ||<br /> strcmp(listen_addr, "127.0.0.1") 0 ||<br /> strcmp(listen_addr, "::1") == 0) {</code></pre>
DragonFlyBSD - Bug #3108 (Closed): sys/dev/disk/fd/fd.c:802: suspicious if statement ?
https://bugs.dragonflybsd.org/issues/3108
2017-12-04T16:20:54Z
dcb
<p>dragonfly/sys/dev/disk/fd/fd.c:799] -> [dragonfly/sys/dev/disk/fd/fd.c:802]: (warning) Opposite inner 'if' condition leads to a dead code block.</p>
<p>Source code is</p>
<pre><code>error = isa_dma_acquire(fdc->dmachan);<br /> if (!error) {<br /> isa_dma_init(fdc->dmachan, 128 << 3 /* XXX max secsize */,<br /> M_WAITOK);<br /> if (error) {<br /> isa_dma_release(fdc->dmachan);</code></pre>
DragonFlyBSD - Bug #3103 (Closed): sys/dev/video/bktr/bktr_core.c: 3 * poor error checking ?
https://bugs.dragonflybsd.org/issues/3103
2017-11-15T10:36:11Z
dcb
<p>1.</p>
<p>dragonfly/sys/dev/video/bktr/bktr_core.c:1845]: (style) Checking if unsigned variable 'temp' is less than zero.</p>
<pre><code>temp = tv_channel( bktr, (int)*(unsigned long *)arg );<br /> if ( temp < 0 ) {</code></pre>
<p>but</p>
<pre><code>unsigned int temp, temp1;</code></pre>
<p>and</p>
<p>dragonfly/sys/dev/video/bktr/bktr_tuner.h:int tv_channel( bktr_ptr_t bktr, int channel );</p>
<p>2.</p>
<p>dragonfly/sys/dev/video/bktr/bktr_core.c:1887]: (style) Checking if unsigned variable 'temp' is less than zero.</p>
<p>3.</p>
<p>dragonfly/sys/dev/video/bktr/bktr_core.c:2171]: (style) Checking if unsigned variable 'temp' is less than zero.</p>
<p>Duplicates.</p>
DragonFlyBSD - Bug #3102 (Closed): sys/dev/drm/radeon/radeon_uvd.c:897: possible cut'n'paste issue ?
https://bugs.dragonflybsd.org/issues/3102
2017-11-15T10:23:51Z
dcb
<p>dragonfly/sys/dev/drm/radeon/radeon_uvd.c:897] -> [dragonfly/sys/dev/drm/radeon/radeon_uvd.c:903]: (warning) Identical condition 'vclk_div>pd_max', second condition is always false</p>
<p>Source code is</p>
<pre><code>if (vclk_div > pd_max)<br /> break; /* vco is too big, it has to stop */</code></pre>
<pre><code>/* calc dclk divider with current vco freq <strong>/<br /> dclk_div = radeon_uvd_calc_upll_post_div(vco_freq, dclk,<br /> pd_min, pd_even);<br /> if (vclk_div > pd_max)<br /> break; /</strong> vco is too big, it has to stop */</code></pre>
<p>Maybe the 2nd if would be better if it sanity checked dclk_div, like</p>
<pre><code>if (dclk_div > pd_max)<br /> break; /* vco is too big, it has to stop */</code></pre>
DragonFlyBSD - Bug #3094 (Closed): dragonfly/sys/vm/vm_page.c:1389: bed sequence of if statements ?
https://bugs.dragonflybsd.org/issues/3094
2017-10-24T11:12:20Z
dcb
<p>dragonfly/sys/vm/vm_page.c:1389]: (style) Expression is always false because 'else if' condition matches previous condition at line 1384.</p>
<p>Source code is</p>
<pre><code>if (m->valid != VM_PAGE_BITS_ALL ||<br /> (m->flags & PG_FICTITIOUS)) {<br /> m = NULL;<br /> } else if (vm_page_sbusy_try(m)) {<br /> m = NULL;<br /> } else if (m->valid != VM_PAGE_BITS_ALL ||<br /> (m->flags & PG_FICTITIOUS)) {<br /> vm_page_sbusy_drop(m);<br /> m = NULL;</code></pre>
DragonFlyBSD - Bug #3083 (Closed): crypto/openssh/auth2-pubkey.c:186]: (style) Suspicious condition
https://bugs.dragonflybsd.org/issues/3083
2017-10-17T16:36:25Z
dcb
<p>crypto/openssh/auth2-pubkey.c:186]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.</p>
<p>Source code is</p>
<pre><code>if ((r = sshbuf_put_cstring(b, "publickey")) != 0 ||<br /> (r = sshbuf_put_u8(b, have_sig)) != 0 ||<br /> (r = sshbuf_put_cstring(b, pkalg) != 0))</code></pre>
<p>Maybe better code</p>
<pre><code>if ((r = sshbuf_put_cstring(b, "publickey")) != 0 ||<br /> (r = sshbuf_put_u8(b, have_sig)) != 0 ||<br /> (r = sshbuf_put_cstring(b, pkalg)) != 0)</code></pre>
DragonFlyBSD - Bug #3079 (Closed): usr.bin/bc/tty.c: 2 * Suspicious condition
https://bugs.dragonflybsd.org/issues/3079
2017-10-11T09:18:56Z
dcb
<p>usr.bin/bc/tty.c:34]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.</p>
<p>Source code is</p>
<pre><code>while ((ret = tcsetattr(0, TCSADRAIN, t) -1) && errno EINTR)</code></pre>
<p>Maybe better code</p>
<pre><code>while (((ret = tcsetattr(0, TCSADRAIN, t)) -1) && errno EINTR)</code></pre>
<p>dragonfly/usr.bin/bc/tty.c:44]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.</p>
<p>Source code is</p>
<pre><code>while ((ret = tcgetattr(0, t) -1) && errno EINTR)</code></pre>
DragonFlyBSD - Bug #3078 (Closed): sys/netinet6/nd6_nbr.c: 2 * redundant condition ?
https://bugs.dragonflybsd.org/issues/3078
2017-10-11T09:06:49Z
dcb
<p>dragonfly/sys/netinet6/nd6_nbr.c:290]: (style) Redundant condition: cmpifp==rtifp. 'cmpifp!=rtifp || (cmpifp==rtifp && (m->m_flags&M_MCAST)==0)' is equivalent to 'cmpifp!=rtifp || (m->m_flags&M_MCAST)==0'</p>
<p>Source code is</p>
<pre><code>if (rt != NULL &&<br /> (cmpifp != rtifp ||<br /> (cmpifp rtifp && (m->m_flags & M_MCAST) 0))</code></pre>
<p>[dragonfly/sys/netinet6/nd6_nbr.c:787]: (style) Redundant condition: !is_override. 'is_override || (!is_override && lladdr&&!llchange)' is equivalent to 'is_override || lladdr&&!llchange'</p>
<p>Source code is</p>
<pre><code>} else if (is_override /* (2a) */
|| (!is_override && (lladdr && !llchange)) /* (2b) */
|| !lladdr) { /* (2c) */</code></pre>
DragonFlyBSD - Bug #3077 (Closed): sys/dev/sound/pci/hda/hdaa.c:3081: dead code ?
https://bugs.dragonflybsd.org/issues/3077
2017-10-11T09:02:38Z
dcb
<p>dragonfly/sys/dev/sound/pci/hda/hdaa.c:3080] -> [dragonfly/sys/dev/sound/pci/hda/hdaa.c:3081]: (warning) Opposite inner 'if' condition leads to a dead code block.</p>
<p>Source code is</p>
<pre><code>for (i = devinfo->startnode; cnt < max && i < devinfo->endnode; i++) {<br /> if (cnt >= max) {<br /> device_printf(devinfo->dev, "%s: Ctl overflow!\n",<br /> <i>func</i>);<br /> break;<br /> }</code></pre>
<p>Suggest remove dead code</p>
DragonFlyBSD - Bug #3076 (New): sys/dev/netif/ig_hal/e1000_ich8lan.c:1594: sanity checking mixup ?
https://bugs.dragonflybsd.org/issues/3076
2017-10-11T08:58:53Z
dcb
<p>dragonfly/sys/dev/netif/ig_hal/e1000_ich8lan.c:1594] -> [dragonfly/sys/dev/netif/ig_hal/e1000_ich8lan.c:1607]: (warning) Identical condition 'ret_val', second condition is always false</p>
<p>Source code is</p>
<pre><code>hw->phy.ops.release(hw);</code></pre>
<pre><code>if (ret_val)<br /> return ret_val;</code></pre>
<p>If release returns a value, then suggest check it, otherwise<br />suggest remove redundant check.</p>
DragonFlyBSD - Bug #3075 (Closed): sys/bus/u4b/wlan/if_upgt.c: 3 * pointless tests ?
https://bugs.dragonflybsd.org/issues/3075
2017-10-11T08:47:09Z
dcb
<p>dragonfly/sys/bus/u4b/wlan/if_upgt.c:1225]: (style) Unsigned variable 'channel' can't be negative so it is unnecessary to test it.</p>
<p>Source code is</p>
<pre><code>if (!(channel >= 0 && channel < IEEE80211_CHAN_MAX))</code></pre>
<p>but</p>
<pre><code>unsigned channel;</code></pre>
<p>Some duplicates:</p>
<p>dragonfly/sys/bus/u4b/wlan/if_upgt.c:1258]: (style) Unsigned variable 'channel' can't be negative so it is unnecessary to test it.<br />dragonfly/sys/bus/u4b/wlan/if_upgt.c:1286]: (style) Unsigned variable 'channel' can't be negative so it is unnecessary to test it.</p>
DragonFlyBSD - Bug #3074 (Closed): crypto/libressl/crypto/asn1/tasn_enc.c:650]: (warning) Possibl...
https://bugs.dragonflybsd.org/issues/3074
2017-10-11T08:34:29Z
dcb
<p>Source code is</p>
<pre><code>if (cout && len)<br /> memcpy(cout, cont, len);</code></pre>
<p>Some paths through the code have cout == NULL. Suggest new code</p>
<pre><code>if (cout && cont && len)<br /> memcpy(cout, cont, len);</code></pre>
DragonFlyBSD - Bug #3073 (Closed): crypto/libressl/crypto/asn1/a_print.c:81: duplicate condition ?
https://bugs.dragonflybsd.org/issues/3073
2017-10-11T08:31:13Z
dcb
<p>dragonfly/crypto/libressl/crypto/asn1/a_print.c:81] -> [dragonfly/crypto/libressl/crypto/asn1/a_print.c:79]: (style) Same expression on both sides of '||'.</p>
<p>Source code is</p>
<table>
<tr>
<td></td>
<td><br /> ((c >= '0') && (c <= '9')) </td>
<td></td>
<td><br /> (c ' ') </td>
<td></td>
<td> (c '\'') </td>
<td></td>
</tr>
</table>
DragonFlyBSD - Bug #3072 (Closed): dragonfly/crypto/libressl/apps/openssl/speed.c:2067: duplicate...
https://bugs.dragonflybsd.org/issues/3072
2017-10-11T08:28:42Z
dcb
<p>dragonfly/crypto/libressl/apps/openssl/speed.c:2067]: (style) Expression is always false because 'else if' condition matches previous condition at line 2047.</p>
<pre><code>} else if (!strncmp(buf, "+F2:", 4)) {</code></pre>
<pre><code>} else if (!strncmp(buf, "+F2:", 4)) {</code></pre>
DragonFlyBSD - Bug #3071 (Closed): dragonfly/sys/dev/raid/mrsas/mrsas_fp.c: 3 * redundant code ?
https://bugs.dragonflybsd.org/issues/3071
2017-10-10T11:15:38Z
dcb
<p>dragonfly/sys/dev/raid/mrsas/mrsas_fp.c:671]: (style) Redundant condition: do_invader. '!A || (A && B)' is equivalent to '!A || B'<br />dragonfly/sys/dev/raid/mrsas/mrsas_fp.c:1393]: (style) Redundant condition: do_invader. '!A || (A && B)' is equivalent to '!A || B'<br />dragonfly/sys/dev/raid/mrsas/mrsas_fp.c:1439]: (style) Variable 'debugBlk' is assigned a value that is never used.</p>