freebsd-dev/contrib/ipfilter/lib
Cy Schubert 3820c3aa3f calloc() and realloc() modernization.
This commit replaces calloc calls, which called calloc() as if it were
malloc() by allocating a multiple of objects as a sizeof multiplied by
the number of objects. The patch rectifies this by calling calloc() as
it was meant to be called.

This commit also replaces realloc() with reallocarray() in a similar
fashion as above. Instead of calculating the memory to reallocated
(changed) by multiplying sizeof by the number of objects, the sizeof
and number are passed as separate arguments to reallocarray(), letting
reallocarray() do the multiplication instead. Like the calloc()
adjustment above, this is approach is cleaner and more elegant than
than the previous code.

This has been tested on my production firewall and a laptop (also
running ipfilter).

Submitted by:	pfg
MFC after:	6 weeks
2017-03-16 04:40:07 +00:00
..
addicmp.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
addipopt.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
alist_free.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
alist_new.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
allocmbt.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
assigndefined.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
bcopywrap.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
binprint.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
buildopts.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
checkrev.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
connecttcp.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
count4bits.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
count6bits.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
debug.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
dupmbt.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
facpri.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
facpri.h Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
familyname.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
fill6bits.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
findword.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
flags.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
freembt.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
ftov.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
gethost.c #553 gethost needs to zero entire IP address structure 2014-09-22 16:06:37 +00:00
geticmptype.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
getifname.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
getnattype.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
getport.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
getportproto.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
getproto.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
getsumd.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
hostname.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
icmpcode.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
icmptypename.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
icmptypes.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
inet_addr.c
initparse.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
interror.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
ionames.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
ipf_dotuning.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
ipf_perror.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
ipft_hx.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
ipft_pc.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
ipft_tx.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
ipoptsec.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
kmem.c Stop including if_var.h from userland. 2015-04-06 09:42:23 +00:00
kmem.h Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
kmemcpywrap.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
kvatoname.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
load_dstlist.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
load_dstlistnode.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
load_file.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
load_hash.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
load_hashnode.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
load_http.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
load_pool.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
load_poolnode.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
load_url.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
Makefile Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
mb_hexdump.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
msgdsize.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
mutex_emul.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
nametokva.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
nat_setgroupmap.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
ntomask.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
optname.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
optprint.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
optprintv6.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
optvalue.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
parsefields.c calloc() and realloc() modernization. 2017-03-16 04:40:07 +00:00
parseipfexpr.c calloc() and realloc() modernization. 2017-03-16 04:40:07 +00:00
parsewhoisline.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
poolio.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
portname.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
prependmbt.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
print_toif.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printactiveaddr.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printactivenat.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printaddr.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printaps.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printbuf.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printdstl_live.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printdstlist.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printdstlistdata.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printdstlistnode.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printdstlistpolicy.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printfieldhdr.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printfr.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printfraginfo.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printhash_live.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printhash.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printhashdata.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printhashnode.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printhost.c Fix compile-time errors when NO_WERROR and WITHOUT_INET6_SUPPORT 2014-07-05 07:15:19 +00:00
printhostmap.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printhostmask.c Fix compile-time errors when NO_WERROR and WITHOUT_INET6_SUPPORT 2014-07-05 07:15:19 +00:00
printifname.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printip.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printipfexpr.c Unbreak with gcc. 2014-07-13 10:38:01 +00:00
printiphdr.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printlog.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printlookup.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printmask.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printnat.c #536 ipnat can try to print rule as dstlist incorrectly 2014-09-22 16:09:18 +00:00
printnataddr.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printnatfield.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printnatside.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printpacket6.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printpacket.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printpool_live.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printpool.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printpooldata.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printpoolfield.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printpoolnode.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printportcmp.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printproto.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printsbuf.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printstate.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printstatefields.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printtcpflags.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printtqtable.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printtunable.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
printunit.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
remove_hash.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
remove_hashnode.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
remove_pool.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
remove_poolnode.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
resetlexer.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
rwlock_emul.c Currently the fragment info is placed at the top of the linked list 2017-01-26 01:24:05 +00:00
save_execute.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
save_file.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
save_nothing.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
save_syslog.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
save_v1trap.c Fix compile-time errors when NO_WERROR and WITHOUT_INET6_SUPPORT 2014-07-05 07:15:19 +00:00
save_v2trap.c Fix leak (free str before returning when ctx's calloc fails). 2017-03-03 21:32:27 +00:00
tcp_flags.c
tcpflags.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
tcpoptnames.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
v6ionames.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
v6optvalue.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
var.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
verbose.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00
vtof.c Update ipfilter 4.1.28 --> 5.1.2. 2013-09-06 23:11:19 +00:00