mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(httpd): validate buf_len in httpd_req_get_url_query_str_ptr()
This commit is contained in:
@@ -1020,7 +1020,9 @@ esp_err_t httpd_req_get_url_query_str(httpd_req_t *r, char *buf, size_t buf_len)
|
||||
|
||||
esp_err_t httpd_req_get_url_query_str_ptr(httpd_req_t *r, const char **buf, size_t *buf_len)
|
||||
{
|
||||
if (r == NULL || buf == NULL) {
|
||||
/* buf_len is an output pointer that is dereferenced below, so it must be
|
||||
* validated along with the other arguments to avoid a NULL write */
|
||||
if (r == NULL || buf == NULL || buf_len == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user