From: Felix Fietkau Date: Mon, 31 Jan 2011 15:24:11 +0000 (+0100) Subject: fix off-by-one in the string validation check X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f01871bc3083c777bc081358dce4d0ed0f2b464c;p=oweals%2Flibubox.git fix off-by-one in the string validation check --- diff --git a/blob.c b/blob.c index 26a23f3..003192e 100644 --- a/blob.c +++ b/blob.c @@ -147,7 +147,7 @@ blob_check_type(const void *ptr, int len, int type) return false; } - if (type == BLOB_ATTR_STRING && data[len] != 0) + if (type == BLOB_ATTR_STRING && data[len - 1] != 0) return false; return true;