Skip to content

Commit d301a88

Browse files
mhdawsondanielleadams
authored andcommitted
http2: fix potential integer overflow
Fix report from coverity on potential integer overflow in http2. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #42248 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 9fa6e44 commit d301a88

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/node_http2.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ Http2Options::Http2Options(Http2State* http2_state, SessionType type) {
197197
// Important: The maxSessionMemory option in javascript is expressed in
198198
// terms of MB increments (i.e. the value 1 == 1 MB)
199199
if (flags & (1 << IDX_OPTIONS_MAX_SESSION_MEMORY))
200-
set_max_session_memory(buffer[IDX_OPTIONS_MAX_SESSION_MEMORY] * 1000000);
200+
set_max_session_memory(buffer[IDX_OPTIONS_MAX_SESSION_MEMORY] *
201+
static_cast<uint64_t>(1000000));
201202

202203
if (flags & (1 << IDX_OPTIONS_MAX_SETTINGS)) {
203204
nghttp2_option_set_max_settings(

0 commit comments

Comments
 (0)