From 92f0ff77a241a72a1e2115240783dbbee61c7150 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 4 Mar 2026 17:51:09 +1100 Subject: [PATCH] Clear errno before calling strtol The previous code was incorrectly clearing errno after calling strtol but before testing the result rather than clearing it and then calling strtol so that changes to errno can be correctly determined. (cherry picked from commit d3ffa1f0073899a96e478906fff5af31eba33784) --- lib/isc/httpd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/isc/httpd.c b/lib/isc/httpd.c index 72f595589c..bfa04ed9bf 100644 --- a/lib/isc/httpd.c +++ b/lib/isc/httpd.c @@ -432,9 +432,8 @@ process_request(isc_httpd_t *httpd, size_t last_len) { if (name_match(header, "Content-Length")) { char *endptr; - long val = strtol(header->value, &endptr, 10); - errno = 0; + long val = strtol(header->value, &endptr, 10); /* ensure we consumed all digits */ if ((header->value + header->value_len) != endptr) {