diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-12 06:58:17 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-12 06:58:17 -0700 |
commit | 21386d3b62ea2fd08a9afd376e39d02185f67baf (patch) | |
tree | 4be40b47f9e0f81ec582af71c0b91141a6bbd8f9 /sysif.c | |
parent | 91b4c9db63bc5c96e100dc2e3e864bba53ba1f39 (diff) | |
download | txr-21386d3b62ea2fd08a9afd376e39d02185f67baf.tar.gz txr-21386d3b62ea2fd08a9afd376e39d02185f67baf.tar.bz2 txr-21386d3b62ea2fd08a9afd376e39d02185f67baf.zip |
lib: revamp overflow checks in vec operations.
* lib.c (vector): Bugfix: we are checking whether
length + 2 is negative, not length. Check the original
value, and simplify everything using check_mulloc.
(list_vec, sub_vec): Use chk_xalloc just in case. There
shouldn't be any overflow if the vector was constructed and
manipulated properly.
(replace_vec): Replace division-based oveflow check with
a simple test that total + 2 doesn't overflow; then
rely on chk_xalloc to do the multiplication overflow
check.
Diffstat (limited to 'sysif.c')
0 files changed, 0 insertions, 0 deletions