fix(httpd): validate buf_len in httpd_req_get_url_query_str_ptr()

This commit is contained in:
Ashish Sharma
2026-07-09 11:20:33 +08:00
parent 629e6767fa
commit 60ce04db6d
2 changed files with 8 additions and 6 deletions
+3 -1
View File
@@ -1016,7 +1016,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;
}