diff options
author | 2017-09-12 15:16:12 -0700 | |
---|---|---|
committer | 2017-09-12 15:16:12 -0700 | |
commit | d71880375506002818de17f74a5d4fd1571cdec7 (patch) | |
tree | 1387fa4964cd589c7dd580115a15631199ac6ace /src/core | |
parent | a06e5fdfb791d65946fe5f6123a3d7dc9f264912 (diff) | |
parent | 20104ce596b8ccbe4cd167e245654f56e8d86edc (diff) |
Merge pull request #12491 from ctiller/ffs
Add a clamp to remove ubsan failure
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ext/transport/chttp2/transport/flow_control.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/ext/transport/chttp2/transport/flow_control.c b/src/core/ext/transport/chttp2/transport/flow_control.c index cec99f6fb6..39aa521029 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.c +++ b/src/core/ext/transport/chttp2/transport/flow_control.c @@ -483,7 +483,8 @@ grpc_chttp2_flowctl_action grpc_chttp2_flowctl_get_bdp_action( if (grpc_bdp_estimator_get_bw(&tfc->bdp_estimator, &bw_dbl)) { // we target the max of BDP or bandwidth in microseconds. int32_t frame_size = (int32_t)GPR_CLAMP( - GPR_MAX((int32_t)bw_dbl / 1000, bdp), 16384, 16777215); + GPR_MAX((int32_t)GPR_CLAMP(bw_dbl, 0, INT_MAX) / 1000, bdp), 16384, + 16777215); grpc_chttp2_flowctl_urgency frame_size_urgency = delta_is_significant( tfc, frame_size, GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE); if (frame_size_urgency != GRPC_CHTTP2_FLOWCTL_NO_ACTION_NEEDED) { |