> > Index: subagentx.c > > =================================================================== > > RCS file: /cvs/src/usr.sbin/relayd/subagentx.c,v > > retrieving revision 1.1 > > diff -u -p -r1.1 subagentx.c > > --- subagentx.c 14 Sep 2020 11:30:25 -0000 1.1 > > +++ subagentx.c 15 Sep 2020 09:05:58 -0000 > > @@ -2929,7 +2929,7 @@ getnext: > > index->sav_idatacomplete = 1; > > break; > > case AGENTX_DATA_TYPE_IPADDRESS: > > - ipaddress = calloc(1, sizeof(ipaddress)); > > + ipaddress = calloc(1, sizeof(*ipaddress)); > > if (ipaddress == NULL) { > > subagentx_log_sag_warn(sag, > > "Failed to bind ipaddress index"); > > Not ok for this, it's probably correct, but there are other instances of this > in this code and so you need to engage brain, not static analyzer, go fix or > don't fix them all in a separate commit. > Could only find one more:
Index: subagentx.c =================================================================== RCS file: /cvs/src/usr.sbin/relayd/subagentx.c,v retrieving revision 1.1 diff -u -p -r1.1 subagentx.c --- subagentx.c 14 Sep 2020 11:30:25 -0000 1.1 +++ subagentx.c 15 Sep 2020 09:27:46 -0000 @@ -2929,7 +2929,7 @@ getnext: index->sav_idatacomplete = 1; break; case AGENTX_DATA_TYPE_IPADDRESS: - ipaddress = calloc(1, sizeof(ipaddress)); + ipaddress = calloc(1, sizeof(*ipaddress)); if (ipaddress == NULL) { subagentx_log_sag_warn(sag, "Failed to bind ipaddress index"); @@ -2951,7 +2951,7 @@ getnext: } if (j <= sav->sav_vb.avb_oid.aoi_idlen) index->sav_idatacomplete = 1; - data->avb_ostring.aos_slen = sizeof(ipaddress); + data->avb_ostring.aos_slen = sizeof(*ipaddress); data->avb_ostring.aos_string = (unsigned char *)ipaddress; break;