summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-04-04 21:33:11 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-04-07 15:53:20 +0200
commit6cef940b40b859e0b80cad1a679818de2a5b418e (patch)
treeae7d556592600a9dbbf40bfcddc4c7d3635baaae /source4
parentb7de06e8e756eb338e40d319095311f8f7d70cba (diff)
downloadsamba-6cef940b40b859e0b80cad1a679818de2a5b418e.tar.gz
samba-6cef940b40b859e0b80cad1a679818de2a5b418e.tar.bz2
samba-6cef940b40b859e0b80cad1a679818de2a5b418e.zip
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
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/schema/schema_syntax.c9
1 files changed, 9 insertions, 0 deletions
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);