Skip to content

Commit 4b4dd60

Browse files
committed
Fix conditions of the pointer pa
1 parent a2961ef commit 4b4dd60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ngx_http_vhost_traffic_status_string.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ ngx_http_vhost_traffic_status_escape_prometheus(ngx_pool_t *pool, ngx_str_t *buf
187187
}
188188
} else {
189189
char_end = pa;
190-
if (*char_end > 0xf8 || ngx_utf8_decode(&char_end, last - pa) > 0x10ffff) {
190+
if (*pa >= 0xf8 || ngx_utf8_decode(&char_end, last - pa) > 0x10ffff) {
191191
break;
192192
} else {
193193
pa = char_end;
@@ -237,7 +237,7 @@ ngx_http_vhost_traffic_status_escape_prometheus(ngx_pool_t *pool, ngx_str_t *buf
237237
}
238238
} else {
239239
char_end = pa;
240-
if (*char_end > 0xf8 || ngx_utf8_decode(&char_end, last - pa) > 0x10ffff) {
240+
if (*pa >= 0xf8 || ngx_utf8_decode(&char_end, last - pa) > 0x10ffff) {
241241
/* invalid UTF-8 - escape single char to allow resynchronization */
242242
c = *pa++;
243243
/* two slashes are required to be valid encoding for prometheus*/

0 commit comments

Comments
 (0)