libmpx/
2016-06-10 Ilya Enkovich <ilya.enkovich@intel.com>
* mpxwrap/mpx_wrappers.c (move_bounds): Fix overflow bug.
From-SVN: r237292
+2016-06-10 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ * mpxwrap/mpx_wrappers.c (move_bounds): Fix overflow bug.
+
2016-01-20 Matthias Klose <doko@ubuntu.com>
* libtool-version: Remove.
#include "string.h"
#include <sys/mman.h>
#include <stdint.h>
+#include <assert.h>
#include "mpxrt/mpxrt.h"
void *
else
elems_to_copy -= src_bt_index_end + 1;
}
- src_bd_index_end--;
+ /* Go to previous table but beware of overflow.
+ We should have copied all required element
+ in case src_bd_index_end is 0. */
+ if (src_bd_index_end)
+ src_bd_index_end--;
+ else
+ {
+ assert (!elems_to_copy);
+ return;
+ }
/* For each bounds table we check if there are valid pointers inside.
If there are some, we copy table in pre-counted portions. */
for (; src_bd_index_end > src_bd_index; src_bd_index_end--)