From 6cef940b40b859e0b80cad1a679818de2a5b418e Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 4 Apr 2011 21:33:11 +0200 Subject: dsdb:schema/schema_syntax.c - add some empty value checks on validate functions They are needed since the check in "ldb_msg_sanity_check" will be removed. Reviewed-by: abartlet --- source4/dsdb/schema/schema_syntax.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4') diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index 8be87df827..afb53377fe 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -254,6 +254,10 @@ static WERROR dsdb_syntax_BOOL_validate_ldb(const struct dsdb_syntax_ctx *ctx, for (i=0; i < in->num_values; i++) { int t, f; + if (in->values[i].length == 0) { + return WERR_DS_INVALID_ATTRIBUTE_SYNTAX; + } + t = strncmp("TRUE", (const char *)in->values[i].data, in->values[i].length); @@ -1379,6 +1383,11 @@ static WERROR _dsdb_syntax_OID_validate_numericoid(const struct dsdb_syntax_ctx char *oid_out; const char *oid = (const char*)in->values[i].data; + if (in->values[i].length == 0) { + talloc_free(tmp_ctx); + return WERR_DS_INVALID_ATTRIBUTE_SYNTAX; + } + if (!ber_write_OID_String(tmp_ctx, &blob, oid)) { DEBUG(0,("ber_write_OID_String() failed for %s\n", oid)); talloc_free(tmp_ctx); -- cgit