diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-01-31 05:30:41 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-01-31 05:32:28 +0300 |
commit | ec593913f4a5ee31d4a295708ba91beb0d439ffe (patch) | |
tree | 846cdabd93ed70eb9ca0cde735c88bfb5775630a /blob.c | |
parent | da2876acd93e2471db455c253b20619e523a9694 (diff) |
blob: validate strings on parse
Diffstat (limited to 'blob.c')
-rw-r--r-- | blob.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) { int id = blob_id(pos); int len = blob_len(pos); + char *pdata; if (id >= max) 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) continue; |