tgockel / json-voorhees

A killer modern C++ library for interacting with JSON.
http://tgockel.github.io/json-voorhees/
Apache License 2.0
128 stars 18 forks source link

fix stack overflow #71

Closed venediktov closed 8 years ago

venediktov commented 8 years ago

the size of allocated on the stack array to support T is too large , it causes stack overflow in template T extract(const value& from) const called recursively

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 95.629% when pulling bbff24f6934f761e1904e73b2b2d3f4dc7ef4a1c on venediktov:master into 9e5603265e37da3d50bcfbd96cdc6997551906e6 on tgockel:master.

tgockel commented 8 years ago

Oh, wow...I'm dumb. Thanks!

venediktov commented 8 years ago

Don't be so hard on yourself , you probably first implemented your stack storage as unsigned char place [sizeof(T)] ; And later decided to used aligned structure from std which is already of size T , but did not remove declaration from array . I had quite few typos like that myself - very hard to catch those because it compiles , it runs but only breaks in the edge cases ...

Sent from my iPhone

On Jun 27, 2016, at 9:32 AM, Travis Gockel notifications@github.com wrote:

Oh, wow...I'm dumb. Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.