MCPcopy Create free account
hub / github.com/apache/httpd / ajp_msg_get_string

Function ajp_msg_get_string

modules/proxy/ajp_msg.c:501–524  ·  view source on GitHub ↗

* Get a String value from AJP Message * * @param msg AJP Message to get value from * @param rvalue Pointer where value will be returned * @return APR_SUCCESS or error */

Source from the content-addressed store, hash-verified

499 * @return APR_SUCCESS or error
500 */
501apr_status_t ajp_msg_get_string(ajp_msg_t *msg, const char **rvalue)
502{
503 apr_uint16_t size;
504 apr_size_t start;
505 apr_status_t status;
506
507 status = ajp_msg_get_uint16(msg, &size);
508 start = msg->pos;
509
510 if ((status != APR_SUCCESS) || (size + start >= msg->len)) {
511 return ajp_log_overflow(msg, "ajp_msg_get_string");
512 }
513
514 /* Verify that the expected null terminator is actually present */
515 if (msg->buf[start + size] != '\0') {
516 return ajp_log_overflow(msg, "ajp_msg_get_string");
517 }
518
519 msg->pos += (apr_size_t)size;
520 msg->pos++; /* a String in AJP is NULL terminated */
521
522 *rvalue = (const char *)(msg->buf + start);
523 return APR_SUCCESS;
524}
525
526
527/**

Callers 1

ajp_unmarshal_responseFunction · 0.85

Calls 2

ajp_msg_get_uint16Function · 0.85
ajp_log_overflowFunction · 0.85

Tested by

no test coverage detected