summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/schema.c
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-03-11 03:47:36 +0000
committerRich Megginson <rmeggins@redhat.com>2005-03-11 03:47:36 +0000
commit9667f84c94b16d51743bea68df24aeee57bf6f82 (patch)
tree3e4ac798dc26f0fb3c7883c88d83c5e254f08384 /ldap/servers/slapd/schema.c
parent5a9fd42bc4bfc2ca4a4fad2f10881ea16cf504ea (diff)
downloadds-9667f84c94b16d51743bea68df24aeee57bf6f82.tar.gz
ds-9667f84c94b16d51743bea68df24aeee57bf6f82.tar.xz
ds-9667f84c94b16d51743bea68df24aeee57bf6f82.zip
This one is mostly strcpy/strcat checking, checking for null strings before strlen, removing some dead code, other odds and ends.
Diffstat (limited to 'ldap/servers/slapd/schema.c')
-rw-r--r--ldap/servers/slapd/schema.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c
index 7162a968..632120c6 100644
--- a/ldap/servers/slapd/schema.c
+++ b/ldap/servers/slapd/schema.c
@@ -3183,6 +3183,11 @@ read_at_ldif(const char *input, struct asyntaxinfo **asipp, char *errorbuf,
attr_names = parse_qdescrs(psbAttrName->buffer, &num_names);
if ( NULL != attr_names ) {
first_attr_name = attr_names[0];
+ } else { /* NAME followed by nothing violates syntax */
+ schema_create_errormsg( errorbuf, errorbufsize, schema_errprefix_at,
+ input, "Missing or invalid attribute name" );
+ status = invalid_syntax_error;
+ goto done;
}
}
@@ -3192,7 +3197,7 @@ read_at_ldif(const char *input, struct asyntaxinfo **asipp, char *errorbuf,
* if the attribute ldif doesn't have an OID, we'll make the oid
* attrname-oid
*/
- if ( strcasecmp ( pOid, "NAME" ) == 0 ) {
+ if ( (strcasecmp ( pOid, "NAME" ) == 0) && (first_attr_name)) {
slapi_ch_free_string( &pOid );
pOid = slapi_ch_smprintf("%s-oid", first_attr_name );
}