From: Felix Fietkau Date: Mon, 31 Jan 2011 02:30:41 +0000 (+0100) Subject: blob: validate strings on parse X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ec593913f4a5ee31d4a295708ba91beb0d439ffe;p=oweals%2Flibubox.git blob: validate strings on parse --- 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;