The root password is irrelevant if you can just overflow a buffer (or even worse, the runtime stack) and execute malicious code. OSX’s problem is its lack of memory protection, which is fairly common among *nix systems.
Or? The point of overflowing the buffer IS to get your executable code onto the stack at the right spot.