Skip to content

Commit

Permalink
* Allow larger fields in UPnP requests, to work better with long Logi…
Browse files Browse the repository at this point in the history
…tech Revue Search requests.
  • Loading branch information
Justin Maggard committed Aug 16, 2011
1 parent 588b33e commit 40364c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions upnpreplyparse.c
Expand Up @@ -47,11 +47,11 @@ NameValueParserStartElt(void * d, const char * name, int l)
if(!data->head.lh_first)
{
struct NameValue * nv;
nv = malloc(sizeof(struct NameValue));
nv = malloc(sizeof(struct NameValue)+l+1);
strcpy(nv->name, "rootElement");
memcpy(nv->value, name, l);
nv->value[l] = '\0';
LIST_INSERT_HEAD( &(data->head), nv, entries);
LIST_INSERT_HEAD(&(data->head), nv, entries);
}
}

Expand All @@ -60,14 +60,14 @@ NameValueParserGetData(void * d, const char * datas, int l)
{
struct NameValueParserData * data = (struct NameValueParserData *)d;
struct NameValue * nv;
nv = malloc(sizeof(struct NameValue));
if(l>511)
l = 511;
if(l>1975)
l = 1975;
nv = malloc(sizeof(struct NameValue)+l+1);
strncpy(nv->name, data->curelt, 64);
nv->name[63] = '\0';
memcpy(nv->value, datas, l);
nv->value[l] = '\0';
LIST_INSERT_HEAD( &(data->head), nv, entries);
LIST_INSERT_HEAD(&(data->head), nv, entries);
}

void
Expand Down
2 changes: 1 addition & 1 deletion upnpreplyparse.h
Expand Up @@ -38,7 +38,7 @@ extern "C" {
struct NameValue {
LIST_ENTRY(NameValue) entries;
char name[64];
char value[512];
char value[];
};

struct NameValueParserData {
Expand Down

0 comments on commit 40364c8

Please sign in to comment.