fixed yajl-related deserialization crash
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Sun, 26 Jul 2009 00:24:53 +0000 (18:24 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Sun, 26 Jul 2009 00:24:53 +0000 (18:24 -0600)
src/deserializer.cc

index 8ad30591a54cb7087f788acb92c0a845b0842439..929c3c12183fdf3c5f10ccee3cbb6e09a7a065ea 100644 (file)
@@ -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,
This page took 0.023423 seconds and 4 git commands to generate.