The punishment which a court-martial may direct for an offense may not exceed the limits prescribed by this code or by federal law.