From 63186c80fc72926f2b39b5aa63e6c3d18185641d Mon Sep 17 00:00:00 2001 From: rofu Date: Thu, 24 Dec 2009 07:28:19 +0000 Subject: [PATCH] Change if(nrhs > 0 && nrhs < 5) to if(nrhs > 1 && nrhs < 5) in mexFunction to make sure accessing prhs[1] is legal. --- matlab/train.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/train.c b/matlab/train.c index 2a97feb..8a6b919 100644 --- a/matlab/train.c +++ b/matlab/train.c @@ -283,7 +283,7 @@ void mexFunction( int nlhs, mxArray *plhs[], srand(1); // Transform the input Matrix to libsvm format - if(nrhs > 0 && nrhs < 5) + if(nrhs > 1 && nrhs < 5) { int err=0; -- 2.40.0