What SHOULD prevent an out of battery situation if the trigger is pulled is the receivers firing pin interlock.
This is a system where the receiver has a block area that prevents the firing pin from moving forward and firing the cartridge even if the hammer drops, until the bolt is locked.
In the M1 Carbine, M1 Rifle, and M14/M1A this is a "bridge" across the lower receiver that holds the firing pin back until the bolt has rotated to lock.
Where this can fail is with a badly worn action, a worn or broken firing pin, a non-USGI receiver that's out of spec, or a scrapped receiver that's been cut in half, then welded together.
As long as everything is as it is supposed to be, if the hammer drops before the bolt is locked, the rifle should not fire.
You can test this by removing the action from the stock and turning it over.
Open the bolt then ease it shut while watching the rear of the firing pin.
As the bolt closes, the "L" shaped firing pin will engage the interlock bridge and the pin will be held back until the bolt has locked.