From: Charles McGarvey Date: Sun, 26 Jul 2009 00:24:53 +0000 (-0600) Subject: fixed yajl-related deserialization crash X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=e1a8eee026993b860c557c87ec559c902a4b6a11;p=chaz%2Fyoink fixed yajl-related deserialization crash --- diff --git a/src/deserializer.cc b/src/deserializer.cc index 8ad3059..929c3c1 100644 --- a/src/deserializer.cc +++ b/src/deserializer.cc @@ -120,6 +120,7 @@ public: static int parsedMapKey(void* ctx, const unsigned char* value, unsigned length) { + // same thing as a string return parsedString(ctx, value, length); } @@ -181,7 +182,9 @@ public: private: void init(std::istream& input, bool deleteIn, bool comments, bool check) { - const yajl_callbacks callbacks = + // this has to be static because yajl actually does not copy it into its + // internal data structures but rather keeps a pointer to this + static const yajl_callbacks callbacks = { deserializer_impl::parsedNull, deserializer_impl::parsedBoolean,