Yes, but how is this function accessing any memory other than its own?
From what we're given, it's a straight forward calculation. It doesn't recurse, and the function scanf prevents buffer overflows (for the most part).
I don't see how this function could wind up accessing any memory other than its own given to it by the OS.