A
miscarriage of justice primarily is the
conviction and
punishment of a person for a
crime they did not commit. The term can also apply to errors in the other direction—"
errors of impunity", and to
civil cases. Most
criminal justice systems have some means to overturn, or "quash", a wrongful conviction, but this is often difficult to achieve. In some instances a wrongful conviction is not overturned for several years, or until after the innocent person has been
executed, released from custody, or has died.