]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/mods.c
Do not require ac/string.h for lber_pvt.h
[openldap] / servers / slapd / mods.c
index 1137b21762eb678c05164caad31d0a7976c0206d..7d4f02d68ac5235f69164ffc303d74e2a18f67dd 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2014 The OpenLDAP Foundation.
+ * Copyright 1998-2018 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -388,6 +388,7 @@ modify_increment_values(
        char *textbuf, size_t textlen )
 {
        Attribute *a;
+       const char *syn_oid;
 
        a = attr_find( e->e_attrs, mod->sm_desc );
        if( a == NULL ) {
@@ -406,7 +407,8 @@ modify_increment_values(
                }
        }
 
-       if ( !strcmp( a->a_desc->ad_type->sat_syntax_oid, SLAPD_INTEGER_SYNTAX )) {
+       syn_oid = at_syntax( a->a_desc->ad_type );
+       if ( syn_oid && !strcmp( syn_oid, SLAPD_INTEGER_SYNTAX )) {
                int i;
                char str[sizeof(long)*3 + 2]; /* overly long */
                long incr;
@@ -446,7 +448,7 @@ modify_increment_values(
                snprintf( textbuf, textlen,
                        "modify/increment: %s: increment not supported for value syntax %s",
                        mod->sm_desc->ad_cname.bv_val,
-                       a->a_desc->ad_type->sat_syntax_oid );
+                       syn_oid ? syn_oid : "(NULL)" );
                return LDAP_CONSTRAINT_VIOLATION;
        }