ORCID / bibtexParseJs

A JavaScript library that parses BibTeX parser.
MIT License
107 stars 39 forks source link

bibtexParseJs hangs when there is an open quote and missing closing } #19

Closed dasfreak closed 6 years ago

dasfreak commented 6 years ago

Hey,

I tried to use your library to validate some bibtex inputs. At first I tried it while typing but sometimes it would just hang. So I changed to validate on submit but in the rare condition of an open quote and a non-closed curly delimiter you library runs into a endless loop.

I also checked your test suite and it seems that this is not covered.

This affects Chrome 61.0.3163.100 (Official Build) (64-bit) as well as Firefox 56.0 (64-bit).

This is a snippet of what I used to crash the library:

@article{smolvcic2009dust,
      title={The Dust-Unbiased Cosmic Star-Formation History from the 20 CM VLA-COSMOS Survey},
      author={Smol{\v{c}}i{\'c}, V and Schinnerer, E and Zamorani, G and Bell, EF and Bondi, M and Carilli, CL and Ciliegi, P and Mobasher, B and Paglione, T and Scodeggio, M and others},
      journal={The Astrophysical Journal},
      volume="
rcpeters commented 6 years ago

Just pushed some code that clarifies this. It doesn't hang it throws an error.