Use reallocarray(3) when reallocation involves a multiplication.
AFAICT, these libraries that are not meant to be portable so
reallocarray(3) is not a maintainance concern.
Details
Details
- Reviewers
ngie delphij bapt - Commits
- rS317265: lib: initial use of reallocarray(3).
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 8020 Build 8196: CI src build Jenkins Build 8195: arc lint + arc unit
Event Timeline
Comment Actions
Minor enhancement in libthread_db, move a multiplier to the second
argument to reduce risk of an overflow in the first argument.
Comment Actions
I'm ok with the non-contributed source code being adapted to the new pattern (sidenote: I'm a bit sad that these libraries aren't in contrib/)..
lib/libiconv_modules/ISO2022/citrus_iso2022.c | ||
---|---|---|
262–263 | I would leave this hunk alone since it's citrus iconv is shared between FreeBSD and IllumOS. | |
lib/libusbhid/usage.c | ||
116 | This code came from NetBSD. I'd probably leave it alone. |
Comment Actions
TBH, I am wondering the usefulness fo these replacements.
It is not clear if overflows are possible at all. OTOH I am pretty sure the changes won't hurt.
lib/libiconv_modules/ISO2022/citrus_iso2022.c | ||
---|---|---|
262–263 | This comes from NetBSD/citrus. Illumos has it because we are their upstream for this, and illumos will be adopting reallocarray(3) as well. |