Variables out of control!

It doesn't sound like a memory thing to me.

Does to me. Classic buffer overrun bug.