From 8bb422b1fc487da1842a1dc1152ff6f0cdb21b73 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 26 Mar 2012 09:53:52 +0000 Subject: [PATCH] fixed potential buffer size overflow in Boost::update_weight, bug #1524 (thanks to benlemna for the patch) --- modules/ml/src/boost.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ml/src/boost.cpp b/modules/ml/src/boost.cpp index af3a8382ae..3d938c7408 100644 --- a/modules/ml/src/boost.cpp +++ b/modules/ml/src/boost.cpp @@ -1126,7 +1126,7 @@ CvBoost::update_weights( CvBoostTree* tree ) int *sample_idx_buf; const int* sample_idx = 0; cv::AutoBuffer inn_buf; - int _buf_size = (params.boost_type == LOGIT) || (params.boost_type == GENTLE) ? data->sample_count*sizeof(int) : 0; + size_t _buf_size = (params.boost_type == LOGIT) || (params.boost_type == GENTLE) ? data->sample_count*sizeof(int) : 0; if( !tree ) _buf_size += n*sizeof(int); else