diff options
author | 2014-10-12 13:08:47 +0000 | |
---|---|---|
committer | 2014-10-12 13:08:47 +0000 | |
commit | 0b5df6d6a4aaa474dcc0a7059190a813e5a6261f (patch) | |
tree | 8daea27a6c4afb338b3307fe181c7035cf6bd8ac /sys/dev/isa/files.isa | |
parent | document the semantics of operation keywords (diff) | |
download | wireguard-openbsd-0b5df6d6a4aaa474dcc0a7059190a813e5a6261f.tar.xz wireguard-openbsd-0b5df6d6a4aaa474dcc0a7059190a813e5a6261f.zip |
Remove possibility of mutiplicative integer overflow by not multiplying.
Instead of the widespread-but-overflow-prone
while (newlen < wanted) { newlen *= 2; }
idiom, just realloc() for the space requested by the caller and check
for additive overflow.
Also change type of 'newlen' variable from int to size_t to avoid
overflows there.
Pointed out by deraadt@
ok reyk@
Diffstat (limited to 'sys/dev/isa/files.isa')
0 files changed, 0 insertions, 0 deletions