Are you shooting it while in space or from outside space to
inside space? Well the bullet wouldn't stop until it hit a
gravitational pull and it would get drawn in. You would also get
blown back by the force.
Very few firearms would fire in the vacuum of space. Oxygen is
necessary for ignition, and bullets are not sealed; any oxygen
contained within the cartridge is likely to leak out with exposure
to the vacuum.
The US did develop one family of firearms that would fire in
vacuum, the Gyrojet. Gyrojets were built in different calibers and
configurations. There were pistols and rifles. Essentially, the
Gyrojet fired a small rocket with a gas propellant, that ignited
within 30 feet of the barrel. There was very little if any recoil,
and the effective range was greater that a conventional powder
round.