This code updates pointers to a reallocated buffer to point to the new
buffer. It is not conforming (does arithmetics with freed pointers),
but it also creates invalid capabilities because the provenance is
derived from the original freed pointers instead of the new buffer.
Change the arithmetics so provenance is derived from the new buffer.
The conformance issue is not fixed.
for (i = 0; i < nmap; i++)
{
- map[i].alias += new_pool - string_space;
- map[i].value += new_pool - string_space;
+ map[i].alias = new_pool
+ + (map[i].alias - string_space);
+ map[i].value = new_pool
+ + (map[i].value - string_space);
}
}