From f01871bc3083c777bc081358dce4d0ed0f2b464c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 31 Jan 2011 16:24:11 +0100 Subject: [PATCH] fix off-by-one in the string validation check --- blob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.25.1