darray: check integer overflow