tmpDN[nrdns++] = newRDN;
newRDN = NULL;
+#if 0
+ /*
+ * prone to attacks?
+ */
assert (nrdns < TMP_SLOTS);
+#else
+ /*
+ * make the static AVA array dynamically rescalable
+ */
+ if (nrdns >= TMP_SLOTS) {
+ rc = LDAP_DECODING_ERROR;
+ goto parsing_error;
+ }
+#endif
if ( p[ 0 ] == '\0' ) {
/*
* here STRING means RFC 2253 string
* FIXME: what about DCE strings?
*/
- state = B4STRINGVALUE;
+ if ( !p[ 0 ] ) {
+ /* empty value */
+ state = GOTAVA;
+ } else {
+ state = B4STRINGVALUE;
+ }
break;
case B4BINARYVALUE:
*/
ava = ldapava_new( &attrType, &attrValue,
attrValueEncoding );
+
if ( ava == NULL ) {
rc = LDAP_NO_MEMORY;
goto parsing_error;
}
tmpRDN[navas++] = ava;
+ attrValue.bv_val = NULL;
+ attrValue.bv_len = 0;
+
assert(navas < TMP_SLOTS);
}