]> git.kaiwu.me - nginx.git/commitdiff
Fixed Priority parsing of large integers on 32-bit platforms
authornishat shabbir <nishat@bugqore.com>
Thu, 15 Oct 2026 14:45:37 +0000 (20:15 +0530)
committerSergey Kandaurov <pluknet@nginx.com>
Thu, 15 Oct 2026 15:37:10 +0000 (19:37 +0400)
On 32-bit platforms, ngx_atoi() fails on syntactically valid Integers
above 2147483647, and the whole Priority field was rejected.  Now such
values are ignored, similar to Decimals.

src/http/ngx_http_priority.c

index 91217725b4e7b2b2f0ad233d431fb75ab975b9f1..a3957ec3a5d377b6efcf91ed13a9d0bde1a27ac0 100644 (file)
@@ -521,7 +521,13 @@ ngx_http_priority_parse_number(u_char **pos, u_char *end, ngx_int_t *type,
 
     n = ngx_atoi(start, last - start);
     if (n == NGX_ERROR) {
-        return NGX_ERROR;
+
+        /* a valid Integer exceeding ngx_int_t: parsed and discarded */
+
+        *type = NGX_HTTP_PRIORITY_OTHER;
+        *value = 0;
+        *pos = last;
+        return NGX_OK;
     }
 
     *type = NGX_HTTP_PRIORITY_INTEGER;