The favored progenitor model for short γ-ray bursts (SGRBs) is the merger of two neutron stars that triggers an explosion with a burst of collimated γ-rays. Following the initial prompt emission, some SGRBs exhibit a plateau phase in their X-ray light curves that indicates additional energy injection from a central engine, believed to be a rapidly rotating, highly magnetized neutron star. The collapse of this "protomagnetar" to a black hole is likely to be responsible for a steep decay in X-ray flux observed at the end of the plateau. In this paper, we show that these observations can be used to effectively constrain the equation of state of dense matter. In particular, we show that the known distribution of masses in binary neutron star systems, together with fits to the X-ray light curves, provides constraints that exclude the softest and stiffest plausible equations of state. We further illustrate how a future gravitational wave observation with Advanced LIGO/Virgo can place tight constraints on the equation of state, by adding into the picture a measurement of the chirp mass of the SGRB progenitor.