mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Compatibility with libyajl decoding the buffer inline
This commit is contained in:
parent
b3b33c9ff1
commit
0d5a8dec2a
@ -354,7 +354,9 @@ int json_init(modsec_rec *msr, char **error_msg) {
|
||||
int json_process_chunk(modsec_rec *msr, const char *buf, unsigned int size, char **error_msg) {
|
||||
if (error_msg == NULL) return -1;
|
||||
*error_msg = NULL;
|
||||
base_offset=buf;
|
||||
// Take a copy in case libyajl decodes the buffer inline
|
||||
base_offset = apr_pstrmemdup(msr->mp, buf, size);
|
||||
if (!base_offset) return -1;
|
||||
|
||||
/* Feed our parser and catch any errors */
|
||||
msr->json->status = yajl_parse(msr->json->handle, buf, size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user