From d3ffa1f0073899a96e478906fff5af31eba33784 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. --- 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 13b3d55a63..910e15d00f 100644 --- a/lib/isc/httpd.c +++ b/lib/isc/httpd.c @@ -419,9 +419,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) {