Old-Ding opened a new pull request, #3602:
URL: https://github.com/apache/nuttx-apps/pull/3602

   ## Summary
   - make `xmlrpc_getheader()` treat its size argument as the destination 
capacity
   - reserve one byte for the terminating NUL while copying the header value
   - pass `sizeof(value)` from `xmlrpc_handler()` instead of the HTTP request 
buffer size
   
   ## Why
   `xmlrpc_handler()` stores `Content-Length` in `value`, which is sized as 
`CONFIG_XMLRPC_STRINGSIZE + 1`. The previous call passed 
`CONFIG_EXAMPLES_XMLRPC_BUFFERSIZE` to `xmlrpc_getheader()`; with the defaults, 
that permits copying up to 1024 bytes into a 65 byte destination.
   
   The helper also wrote the terminator after allowing `i == size`, so the 
capacity contract should reserve space for the NUL byte.
   
   ## Testing
   - `git diff --check HEAD~1..HEAD`
   - `git show --stat --check --format=fuller HEAD`
   - Not run: local NuttX apps build, because this Windows workstation does not 
have `gcc`, `clang`, or `cc` installed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to