diff options
Diffstat (limited to 'lib/ldb/common')
-rw-r--r-- | lib/ldb/common/attrib_handlers.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ldb/common/attrib_handlers.c b/lib/ldb/common/attrib_handlers.c index 2f4454c7b4..73e1705593 100644 --- a/lib/ldb/common/attrib_handlers.c +++ b/lib/ldb/common/attrib_handlers.c @@ -166,12 +166,12 @@ static int ldb_comparison_Integer(struct ldb_context *ldb, void *mem_ctx, static int ldb_canonicalise_Boolean(struct ldb_context *ldb, void *mem_ctx, const struct ldb_val *in, struct ldb_val *out) { - if (strncasecmp((char *)in->data, "TRUE", in->length) == 0) { + if (in->length >= 4 && strncasecmp((char *)in->data, "TRUE", in->length) == 0) { out->data = (uint8_t *)talloc_strdup(mem_ctx, "TRUE"); out->length = 4; - } else if (strncasecmp((char *)in->data, "FALSE", in->length) == 0) { + } else if (in->length >= 5 && strncasecmp((char *)in->data, "FALSE", in->length) == 0) { out->data = (uint8_t *)talloc_strdup(mem_ctx, "FALSE"); - out->length = 4; + out->length = 5; } else { return -1; } |