Merge "Check integer overflow to prevent memory corruption" into klp-dev