From: David van Moolenbroek Date: Mon, 30 Jul 2012 13:59:43 +0000 (+0000) Subject: rtl8139: resolve Coverity warnings X-Git-Tag: v3.2.1~419 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=90e2b939ab5ca5725e3008e560972a41d35d04d3;p=minix.git rtl8139: resolve Coverity warnings --- diff --git a/drivers/rtl8139/rtl8139.c b/drivers/rtl8139/rtl8139.c index aef58df33..68c71661d 100644 --- a/drivers/rtl8139/rtl8139.c +++ b/drivers/rtl8139/rtl8139.c @@ -391,7 +391,7 @@ static void rl_pci_conf() rep= &re_state; - strcpy(rep->re_name, "rtl8139#0"); + strlcpy(rep->re_name, "rtl8139#0", sizeof(rep->re_name)); rep->re_name[8] += re_instance; rep->re_seen= FALSE; @@ -800,12 +800,14 @@ static void rl_readv_s(const message *mp, int from_int) d_start= rl_inw(port, RL_CAPR) + RL_CAPR_DATA_OFF; d_end= rl_inw(port, RL_CBR) % RX_BUFSIZE; +#if RX_BUFSIZE <= USHRT_MAX if (d_start >= RX_BUFSIZE) { printf("rl_readv: strange value in RL_CAPR: 0x%x\n", rl_inw(port, RL_CAPR)); d_start %= RX_BUFSIZE; } +#endif if (d_end > d_start) amount= d_end-d_start;