Skip to content

Commit

Permalink
Merge pull request #10 from arnej27959/master
Browse files Browse the repository at this point in the history
avoid using uninitialized memory
  • Loading branch information
kirimedia authored Oct 12, 2016
2 parents 320611c + 01627d2 commit c81ac70
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ngx_http_graphite_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,7 @@ ngx_http_graphite_template_compile(ngx_conf_t *cf, ngx_array_t *template, const
}
ngx_memcpy(arg->data.data, value->data + s, i - s);
arg->data.len = i - s;
arg->variable = 0;
}
else if (state == TEMPLATE_STATE_VAR_START || state == TEMPLATE_STATE_BRACKET_VAR_START) {
ngx_uint_t find = 0;
Expand All @@ -1428,6 +1429,8 @@ ngx_http_graphite_template_compile(ngx_conf_t *cf, ngx_array_t *template, const
if ((args[a].name.len == i - s) && !ngx_strncmp(args[a].name.data, &value->data[s], i - s)) {
find = 1;
arg->variable = args[a].variable;
arg->data.data = NULL;
arg->data.len = 0;
}
}

Expand Down

0 comments on commit c81ac70

Please sign in to comment.