blob: validate strings on parse
This commit is contained in:
parent
da2876acd9
commit
ec593913f4
1 changed files with 5 additions and 0 deletions
5
blob.c
5
blob.c
|
@ -142,6 +142,7 @@ blob_parse(struct blob_attr *attr, struct blob_attr **data, const struct blob_at
|
||||||
blob_for_each_attr(pos, attr, rem) {
|
blob_for_each_attr(pos, attr, rem) {
|
||||||
int id = blob_id(pos);
|
int id = blob_id(pos);
|
||||||
int len = blob_len(pos);
|
int len = blob_len(pos);
|
||||||
|
char *pdata;
|
||||||
|
|
||||||
if (id >= max)
|
if (id >= max)
|
||||||
continue;
|
continue;
|
||||||
|
@ -158,6 +159,10 @@ blob_parse(struct blob_attr *attr, struct blob_attr **data, const struct blob_at
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pdata = blob_data(pos);
|
||||||
|
if (type == BLOB_ATTR_STRING && pdata[len] != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (info[id].minlen && len < info[id].minlen)
|
if (info[id].minlen && len < info[id].minlen)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue