It's kind of the same reasoning why voting machines are closed source and can only be audited by authorized personnel.
If you write code that takes an input and increments a number, and you're worried that someone might exploit your code, someone else should have wrote the software.
Attach a printer that shows the voter a paper receipt before the receipt goes in a box, and it should be able to prevent against most any electronic attack.