Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/blob.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-31 05:30:41 +0300
committerFelix Fietkau <nbd@openwrt.org>2011-01-31 05:32:28 +0300
commitec593913f4a5ee31d4a295708ba91beb0d439ffe (patch)
tree846cdabd93ed70eb9ca0cde735c88bfb5775630a /blob.c
parentda2876acd93e2471db455c253b20619e523a9694 (diff)
blob: validate strings on parse
Diffstat (limited to 'blob.c')
-rw-r--r--blob.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/blob.c b/blob.c
index 89ed31a..3bd69fa 100644
--- a/blob.c
+++ b/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) {
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;