Author: dcreager
Date: Fri Feb 25 20:33:27 2011
New Revision: 1074687
URL: http://svn.apache.org/viewvc?rev=1074687&view=rev
Log:
AVRO-762. C: Fixed segfault in avro_schema_from_json
We were extracting the parse error text incorrectly from the Jansson
library error struct, which led to a segfault on certain platforms.
Modified:
avro/trunk/lang/c/src/schema.c
Modified: avro/trunk/lang/c/src/schema.c
URL:
http://svn.apache.org/viewvc/avro/trunk/lang/c/src/schema.c?rev=1074687&r1=1074686&r2=1074687&view=diff
==============================================================================
--- avro/trunk/lang/c/src/schema.c (original)
+++ avro/trunk/lang/c/src/schema.c Fri Feb 25 20:33:27 2011
@@ -1092,7 +1092,7 @@ avro_schema_from_json(const char *jsonte
root = json_loads(jsontext, &error->json_error);
if (!root) {
- avro_set_error("Error parsing JSON: %s", error->json_error);
+ avro_set_error("Error parsing JSON: %s",
error->json_error.text);
st_free_table(error->named_schemas);
avro_freet(struct avro_schema_error_t_, error);
return EINVAL;