diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 9e6f0577..1321a354 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -1089,7 +1089,7 @@ static ssize_t session_call_select_padding(nghttp2_session *session, rv = session->callbacks.select_padding_callback(session, frame, max_payloadlen, session->user_data); - if(rv < frame->hd.length || rv > max_payloadlen) { + if(rv < (ssize_t)frame->hd.length || rv > (ssize_t)max_payloadlen) { return NGHTTP2_ERR_CALLBACK_FAILURE; } return rv; diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index cd632bda..568e1153 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -818,7 +818,7 @@ void test_nghttp2_session_recv_premature_headers(void) nghttp2_put_uint16be(framedata + bufoff, frame.hd.length - 1); rv = nghttp2_session_mem_recv(session, framedata + bufoff, framedatalen - bufoff - 1); - CU_ASSERT((ssize_t)framedatalen - bufoff - 1 == rv); + CU_ASSERT((ssize_t)(framedatalen - bufoff - 1) == rv); item = nghttp2_session_get_next_ob_item(session); CU_ASSERT(NULL != item); @@ -3576,12 +3576,12 @@ void test_nghttp2_session_flow_control_data_with_padding_recv(void) data[NGHTTP2_FRAME_HEAD_LENGTH] = 1; data[NGHTTP2_FRAME_HEAD_LENGTH + 1] = 1; - CU_ASSERT(NGHTTP2_FRAME_HEAD_LENGTH + hd.length == + CU_ASSERT((ssize_t)(NGHTTP2_FRAME_HEAD_LENGTH + hd.length) == nghttp2_session_mem_recv(session, data, NGHTTP2_FRAME_HEAD_LENGTH + hd.length)); - CU_ASSERT(hd.length == session->recv_window_size); - CU_ASSERT(hd.length == stream->recv_window_size); + CU_ASSERT((int32_t)hd.length == session->recv_window_size); + CU_ASSERT((int32_t)hd.length == stream->recv_window_size); nghttp2_session_del(session); }