This is just a 1/2” nipple to extend into the tub.
A) this has been leaking for quite some time based on the way the inside looks- I would investigate before installing another nipple.
B) get the right sized nipple, but also you will need to seal around that hole- 1/2” pipe and 1” holes don’t math very well.
C) make sure the new nipple ( or previous reinstalled) is tight enough to not have leaks, I suggest maybe buying a bit of some better Teflon tape or a small amount of pipe dope to help with the process.