FIX: Buffer overrun in emacs mode header logic
authorRobin Luckey <rluckey@geek.net>
Mon, 29 Mar 2010 21:27:39 +0000 (14:27 -0700)
committerRobin Luckey <rluckey@geek.net>
Mon, 29 Mar 2010 21:27:39 +0000 (14:27 -0700)
commit1831488c5fc9ed25ef4ee5fe31ad1695e0215935
tree6a89868ecf9609507ad7ec6883de0edb1a171670
parent845f593133a2e3a2aa508e0c6ce9e268dd63a842
FIX: Buffer overrun in emacs mode header logic

If the emacs mode header is not well-formed (for example, if it is
missing a terminating "-*-"), then we run off the end of our buffer.

The emacs mode header parsing is a little complicated, and the
best answer is probably to clean up the parser. As an easier, quicker,
fix, I simply added a maximum string length check.
src/detector.c