Value of resistor to protect against short circuit
Start by looking at the maximum current both side can source and sink and choose your resistor to limit current flows to those values. However, as @Oldfart said, get the design right is preferable.