From: Mark Andrews Date: Wed, 4 Mar 2026 06:51:09 +0000 (+1100) Subject: Clear errno before calling strtol X-Git-Tag: v9.21.21~33^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3ffa1f0073899a96e478906fff5af31eba33784;p=thirdparty%2Fbind9.git 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. --- diff --git a/lib/isc/httpd.c b/lib/isc/httpd.c index 13b3d55a633..910e15d00fe 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) {