Skip to content

Commit

Permalink
+ model->size was not set.
Browse files Browse the repository at this point in the history
+ Partially incorporated Pull Request #24.
  • Loading branch information
Naoaki Okazaki committed Jan 24, 2016
1 parent 5554ee4 commit 2d5d3a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/crf/src/crf1d_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,12 @@ static crf1dm_t* crf1dm_new_impl(uint8_t* buffer_orig, const uint8_t* buffer, ui

model->buffer_orig = buffer_orig;
model->buffer = buffer;
model->size = size;

if (model->size <= sizeof(header_t)) {
goto error_exit;
}

header = (header_t*)calloc(1, sizeof(header_t));
if (header == NULL) {
goto error_exit;
Expand Down

0 comments on commit 2d5d3a7

Please sign in to comment.