> For much of the code, lengths were converted from ints to size_ts and functions that returned one, zero or minus one were converted to just returning one or zero.
Doesn't google's C code style require using signed ints for lengths?
https://google-styleguide.googlecode.com/svn/trunk/cppguide....
As it should - it's inappropriate to use unsigned types for length because the overflow and underflow behaviors are defined, since they're not defined to what you want. When you have ubsan around, adding defined behavior you don't need just adds places to hide bugs.