Skip to content

Commit

Permalink
httpd: fix openvpn/pptpd account list getting truncated after one entry
Browse files Browse the repository at this point in the history
  • Loading branch information
RMerl committed Mar 17, 2021
1 parent 1e6831e commit 0d62444
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion release/src/router/httpd/web.c
Expand Up @@ -3360,7 +3360,10 @@ int nvram_check(char *name, char *value, struct nvram_tuple *t, char *output)
if(!strcmp(name, "vpn_serverx_clientlist") || !strcmp(name, "pptpd_clientlist"))
{
char *str1 = NULL, *str2 = NULL;
str1 = strtok(value, "<");
char *accounts;

accounts = strdup(value);
str1 = strtok(accounts, "<");
while (str1 != NULL) {
str2 = strchr(str1, '>');
if(str2-str1 > 64 || strlen(str2)-1 > 110){
Expand All @@ -3370,6 +3373,7 @@ int nvram_check(char *name, char *value, struct nvram_tuple *t, char *output)
}
str1 = strtok(NULL, "<");
}
free(accounts);
}
//_dprintf("nvram_check: t->name = %s, t->len = %d, t->type = %d, value = %s, strlen(value) = %d\n", t->name, t->len, t->type, value, strlen(value));
else if(strlen(value) > t->len)
Expand Down

0 comments on commit 0d62444

Please sign in to comment.