From e1a8eee026993b860c557c87ec559c902a4b6a11 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Sat, 25 Jul 2009 18:24:53 -0600 Subject: [PATCH] fixed yajl-related deserialization crash --- src/deserializer.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, -- 2.43.0