Merge pull request #3774 from cesanta/rpc

Validate RPC buffer
This commit is contained in:
robertc2000 authored and GitHub committed 2026-11-12 17:50:41 +02:00
commit c835c72202
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -15353,7 +15353,7 @@ void mg_rpc_process(struct mg_rpc_req *r) {
mg_rpc_call(r, mg_str("")); // JSON response! call "" method handler mg_rpc_call(r, mg_str("")); // JSON response! call "" method handler
} else { } else {
mg_rpc_err(r, -32700, "%m", mg_print_esc, (int) r->frame.len, mg_rpc_err(r, -32700, "%m", mg_print_esc, (int) r->frame.len,
r->frame.buf); // Invalid r->frame.len ? r->frame.buf : ""); // Invalid
} }
} }
+1 -1
View File
@@ -47,7 +47,7 @@ void mg_rpc_process(struct mg_rpc_req *r) {
mg_rpc_call(r, mg_str("")); // JSON response! call "" method handler mg_rpc_call(r, mg_str("")); // JSON response! call "" method handler
} else { } else {
mg_rpc_err(r, -32700, "%m", mg_print_esc, (int) r->frame.len, mg_rpc_err(r, -32700, "%m", mg_print_esc, (int) r->frame.len,
r->frame.buf); // Invalid r->frame.len ? r->frame.buf : ""); // Invalid
} }
} }