Bit late, but if I am not mistaken:
Well if you first take the modulo of "a mod c"
d = a div c
m = a mod c
a = d * c + m
(a*b) = d*b * c + m*b
To get the modulo of "(a*b) mod c" you can also say you wan the modulo of
( d*b*c + m*b ) mod c
since
d*b*c
is dividable by c (c is a factor), you are looking for
(m*b ) mod c
and since "m = a mod c", that means you need
((a mod c) * b) mod c
of course that can still overflow.
But since the above shows that
m2 = (a*b) mod c
can be replaced by
m2 = ((a mod c) * b) mod c
of course, instead of a, we could have replaced b. Lets replace b, the same way in
m2 = ((a mod c) * b) mod c
and we get
m = ((a mod c) * (b mod c)) mod c
It can still overflow. But maybe it is enough in your case