Ah yes. The OP even mentioned tainting. Taint is something I need to use more. The OP really shouldn't be using the same variable name for both the tainted and the untainted variables. Joel wrote an excellent paper on the subject. Admittedly, Joel's language didn't have built in tainting, but I recommend the technique nonetheless.