For the addition of two integers a and b, we know how to safely predict an overflow instance. For two integers addition, the carry will be exactly 1, the remainder is a- (M - b + 1), for a >= b > 0; if b is 0, there won't be overflow.
Safe Integer Addition Coding Experiment 20140629
Experimenting safe addition:
Safe Integer Multiplication Analysis 20140629
Given M >= a >= b > 0, for b =0, no overflow will happen.