]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/value.c
don't return entry if requested attr is not present (ITS#5650)
[openldap] / servers / slapd / value.c
index 64d7298dde912a25ca01855cfad3a813151de93c..1f9d59cb85d7dea9762b57e919fd208c155332b9 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2007 The OpenLDAP Foundation.
+ * Copyright 1998-2008 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -737,7 +737,7 @@ ordered_value_add(
        }
        if ( anum ) {
                AC_MEMCPY( new, a->a_vals, anum * sizeof(struct berval));
-               if ( nnew )
+               if ( nnew && a->a_nvals )
                        AC_MEMCPY( nnew, a->a_nvals, anum * sizeof(struct berval));
        }