Thanks for the patch Tiago - looks good - note, the conversion to size_t still might allow integer overflow BUT since this is unsigned it shouldn't allow access to memory via negative indices, AND with your extra checks against INT_MAX this should be quite safe now.
Thanks for the patch Tiago - looks good - note, the conversion to size_t still might allow integer overflow BUT since this is unsigned it shouldn't allow access to memory via negative indices, AND with your extra checks against INT_MAX this should be quite safe now.