diff --git a/src/mod_wstunnel.c b/src/mod_wstunnel.c index 8051e8a7..57cfb8bf 100644 --- a/src/mod_wstunnel.c +++ b/src/mod_wstunnel.c @@ -707,7 +707,7 @@ static int get_key_number(uint32_t *ret, const buffer *b) { uint32_t sp = 0; char tmp[10 + 1]; /* #define UINT32_MAX_STRLEN 10 */ - for (size_t i = 0, used = b->used; i < used; ++i) { + for (size_t i = 0, used = buffer_string_length(b); i < used; ++i) { if (light_isdigit(s[i])) { tmp[j] = s[i]; if (++j >= sizeof(tmp)) return -1;