If your sure it's the cistern that's overflowing - before you go and replace the ballcock see if giving it a couple of turns stops the flow up and out the overflow.
The plastic/rubber diaphragm disk which is in the fitting that lets the water out may be damaged, they are very cheap to replace (< 3€) and easy too. Just shut off the water, at the end of the arm where the ballcock is attached you will see where the arm goes into the fitting. Unscrew the end of it and carefully remove the diaphragm, clean it and replace it. See if that works, if not replace it.