[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #12855 [Tor]: Use calloc and reallocarray instead of malloc(a*b), malloc_zero(a*b), or realloc(p, a*b)
#12855: Use calloc and reallocarray instead of malloc(a*b), malloc_zero(a*b), or
realloc(p,a*b)
-----------------------+------------------------------------
Reporter: nickm | Owner:
Type: defect | Status: new
Priority: normal | Milestone: Tor: 0.2.6.x-final
Component: Tor | Version:
Keywords: tor-relay | Actual Points:
Parent ID: | Points:
-----------------------+------------------------------------
It's stupid and error-prone to multiply-then-malloc: you're just begging
for an integer overflow. We should add a reallocarray (like OpenBSD uses)
and use spatch/coccinelle to replace all our bad allocations.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12855>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs