aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/json
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/json')
-rw-r--r--src/core/lib/json/json.c2
-rw-r--r--src/core/lib/json/json.h2
-rw-r--r--src/core/lib/json/json_common.h2
-rw-r--r--src/core/lib/json/json_reader.c9
-rw-r--r--src/core/lib/json/json_reader.h2
-rw-r--r--src/core/lib/json/json_string.c2
-rw-r--r--src/core/lib/json/json_writer.c2
-rw-r--r--src/core/lib/json/json_writer.h2
8 files changed, 13 insertions, 10 deletions
diff --git a/src/core/lib/json/json.c b/src/core/lib/json/json.c
index 9793045d91..5b583a1f2e 100644
--- a/src/core/lib/json/json.c
+++ b/src/core/lib/json/json.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/core/lib/json/json.h b/src/core/lib/json/json.h
index 41d87dd5ce..681df4bb77 100644
--- a/src/core/lib/json/json.h
+++ b/src/core/lib/json/json.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/core/lib/json/json_common.h b/src/core/lib/json/json_common.h
index ce980040f8..fa13088be9 100644
--- a/src/core/lib/json/json_common.h
+++ b/src/core/lib/json/json_common.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/core/lib/json/json_reader.c b/src/core/lib/json/json_reader.c
index 0807f029ce..d09cee54f2 100644
--- a/src/core/lib/json/json_reader.c
+++ b/src/core/lib/json/json_reader.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -280,13 +280,14 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader *reader) {
break;
case GRPC_JSON_STATE_OBJECT_KEY_STRING:
- GPR_ASSERT(reader->unicode_high_surrogate == 0);
+ if (reader->unicode_high_surrogate != 0)
+ return GRPC_JSON_PARSE_ERROR;
if (c == '"') {
reader->state = GRPC_JSON_STATE_OBJECT_KEY_END;
json_reader_set_key(reader);
json_reader_string_clear(reader);
} else {
- if (c <= 0x001f) return GRPC_JSON_PARSE_ERROR;
+ if (c < 32) return GRPC_JSON_PARSE_ERROR;
json_reader_string_add_char(reader, c);
}
break;
@@ -362,6 +363,8 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader *reader) {
reader->in_object = 0;
reader->in_array = 1;
break;
+ default:
+ return GRPC_JSON_PARSE_ERROR;
}
break;
diff --git a/src/core/lib/json/json_reader.h b/src/core/lib/json/json_reader.h
index 37a838889d..e0322c5507 100644
--- a/src/core/lib/json/json_reader.h
+++ b/src/core/lib/json/json_reader.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/core/lib/json/json_string.c b/src/core/lib/json/json_string.c
index 8e6f1253dc..4af7ee7179 100644
--- a/src/core/lib/json/json_string.c
+++ b/src/core/lib/json/json_string.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/core/lib/json/json_writer.c b/src/core/lib/json/json_writer.c
index d614a72fc4..b6a17f41e8 100644
--- a/src/core/lib/json/json_writer.c
+++ b/src/core/lib/json/json_writer.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/core/lib/json/json_writer.h b/src/core/lib/json/json_writer.h
index f90e79cd74..faeb41d031 100644
--- a/src/core/lib/json/json_writer.h
+++ b/src/core/lib/json/json_writer.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without