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 18:24:11 +0300
committerFelix Fietkau <nbd@openwrt.org>2011-01-31 18:24:11 +0300
commitf01871bc3083c777bc081358dce4d0ed0f2b464c (patch)
treecd8e0330b94ca3111e7363318781198475db70de /blob.c
parent7a0571a9ff9a9adfe7563db3067f7faf81c815a9 (diff)
fix off-by-one in the string validation check
Diffstat (limited to 'blob.c')
-rw-r--r--blob.c2
1 files changed, 1 insertions, 1 deletions
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;