Skip to content

Commit

Permalink
Merge pull request #3918 from micmn/feature/averaged-perceptron-unini…
Browse files Browse the repository at this point in the history
…tialized-read

Fix uninitialized memory read in AveragedPerceptron
  • Loading branch information
vigsterkr committed Jul 9, 2017
2 parents 6a11ab2 + 7bcbc5f commit 5e5ebb0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/shogun/classifier/AveragedPerceptron.cpp
Expand Up @@ -52,6 +52,7 @@ bool CAveragedPerceptron::train_machine(CFeatures* data)
ASSERT(num_vec==train_labels.vlen)
SGVector<float64_t> w(num_feat);
float64_t* tmp_w=SG_MALLOC(float64_t, num_feat);
memset(tmp_w, 0, sizeof(float64_t)*num_feat);
float64_t* output=SG_MALLOC(float64_t, num_vec);

//start with uniform w, bias=0, tmp_bias=0
Expand Down

0 comments on commit 5e5ebb0

Please sign in to comment.