diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-10-17 17:55:13 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-10-17 17:55:13 -0700 |
commit | 3d95abc9d28983a21215c6156dd9d57374cfed53 (patch) | |
tree | 097c2f218a6ba9cc9796fa44287ca631ec458751 | |
parent | a6d77c200e36995d38bec27bed0976e1beda1b79 (diff) | |
download | txr-3d95abc9d28983a21215c6156dd9d57374cfed53.tar.gz txr-3d95abc9d28983a21215c6156dd9d57374cfed53.tar.bz2 txr-3d95abc9d28983a21215c6156dd9d57374cfed53.zip |
Fix overflow check using wrong variable.
* lib.c (chk_grow_vec): It is newelems which must be compared against
the no_oflow value, not bytes.
-rw-r--r-- | lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2023,7 +2023,7 @@ mem_t *chk_grow_vec(mem_t *old, size_t oldelems, size_t newelems, internal_error("elsize == 0"); if (newelems <= oldelems || - ((bytes > no_oflow || elsize > no_oflow) && bytes / elsize != newelems)) + ((newelems > no_oflow || elsize > no_oflow) && bytes / elsize != newelems)) uw_throw(error_s, lit("array size overflow")); return chk_realloc(old, bytes); |