mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
Merge pull request #3634 from 94xhn/fix/json-hex-validation
Reject malformed input in mg_json_get_hex
This commit is contained in:
5 files changed
+29
-13
No files matched your search
+1
-1
@@ -4163,7 +4163,7 @@ char *mg_json_get_str(struct mg_str json, const char *path);
|
||||
|
||||
// Decodes a hex-encoded JSON string at path into a heap-allocated byte array.
|
||||
// Sets *len to the decoded byte count. Caller must mg_free() the result.
|
||||
// Returns NULL if not found or not a string.
|
||||
// Returns NULL if not found, not a string, or not valid hexadecimal.
|
||||
char *mg_json_get_hex(struct mg_str json, const char *path, int *len);
|
||||
|
||||
// Decodes a base64-encoded JSON string at path into a heap-allocated byte
|
||||
|
||||
Reference in new issue
Block a user