mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-07 02:28:53 +08:00
fix: set max_size as const
Co-authored-by: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com>
This commit is contained in:
@@ -594,9 +594,8 @@ static void hd_map_remove(nghttp2_hd_map *map, nghttp2_hd_entry *ent) {
|
|||||||
static int hd_ringbuf_init(nghttp2_hd_ringbuf *ringbuf, size_t bufsize,
|
static int hd_ringbuf_init(nghttp2_hd_ringbuf *ringbuf, size_t bufsize,
|
||||||
nghttp2_mem *mem) {
|
nghttp2_mem *mem) {
|
||||||
size_t size;
|
size_t size;
|
||||||
size_t max_size;
|
const size_t max_size = SIZE_MAX / sizeof(nghttp2_hd_entry *);
|
||||||
|
|
||||||
max_size = SIZE_MAX / sizeof(nghttp2_hd_entry *);
|
|
||||||
if (bufsize > max_size) {
|
if (bufsize > max_size) {
|
||||||
return NGHTTP2_ERR_NOMEM;
|
return NGHTTP2_ERR_NOMEM;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user