fix off-by-one in the string validation check

This commit is contained in:
Felix Fietkau 2011-01-31 16:24:11 +01:00
parent 7a0571a9ff
commit f01871bc30

2
blob.c
View file

@ -147,7 +147,7 @@ blob_check_type(const void *ptr, int len, int type)
return false; return false;
} }
if (type == BLOB_ATTR_STRING && data[len] != 0) if (type == BLOB_ATTR_STRING && data[len - 1] != 0)
return false; return false;
return true; return true;