Fix wrong size in strlcpy
This commit is contained in:
parent
1d6e8ff037
commit
5747a65664
1 changed files with 1 additions and 1 deletions
|
@ -344,7 +344,7 @@ router_find_endpoint(const char *uri_str, size_t uri_len, struct mg_str *method_
|
||||||
{
|
{
|
||||||
size_t arg_value_str_len = strlen(best_endpoint->args[i].value.v_str);
|
size_t arg_value_str_len = strlen(best_endpoint->args[i].value.v_str);
|
||||||
char *arg_value_str = malloc(sizeof(char) * (arg_value_str_len + 1));
|
char *arg_value_str = malloc(sizeof(char) * (arg_value_str_len + 1));
|
||||||
strlcpy(arg_value_str, best_endpoint->args[i].value.v_str, arg_value_str_len);
|
strlcpy(arg_value_str, best_endpoint->args[i].value.v_str, arg_value_str_len + 1);
|
||||||
best_endpoint->args[i].value.v_str = arg_value_str;
|
best_endpoint->args[i].value.v_str = arg_value_str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue